| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-12-22 12:05 -0500 (Mon, 22 Dec 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble" | 4883 |
| merida1 | macOS 12.7.6 Monterey | x86_64 | 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble" | 4673 |
| kjohnson1 | macOS 13.7.5 Ventura | arm64 | 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble" | 4607 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4671 |
| 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 257/2361 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.74.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| merida1 | macOS 12.7.6 Monterey / x86_64 | OK | OK | WARNINGS | OK | |||||||||
| kjohnson1 | macOS 13.7.5 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
| taishan | Linux (openEuler 24.03 LTS) / aarch64 | OK | OK | OK | ||||||||||
|
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.74.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.74.0.tar.gz |
| StartedAt: 2025-12-19 16:49:40 -0500 (Fri, 19 Dec 2025) |
| EndedAt: 2025-12-19 16:50:34 -0500 (Fri, 19 Dec 2025) |
| EllapsedTime: 54.2 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.74.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.2 Patched (2025-11-04 r88984)
* 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 Ventura 13.7.8
* using session charset: UTF-8
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.74.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.22-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 15.0.0 (clang-1500.0.40.1)’
* used SDK: ‘MacOSX11.3.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 ... NOTE
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... SKIPPED
* checking re-building of vignette outputs ... SKIPPED
* checking PDF version of manual ... OK
* DONE
Status: 1 WARNING, 2 NOTEs
See
‘/Users/biocbuild/bbs-3.22-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.5-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.0.40.1)’
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.5-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 version 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble"
Copyright (C) 2025 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.355 0.123 0.622
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble"
Copyright (C) 2025 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.22-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 480695 25.7 1056201 56.5 NA 634425 33.9
Vcells 890553 6.8 8388608 64.0 65536 2109045 16.1
>
>
>
>
> ##
> ## 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 Dec 19 16:50:05 2025"
> 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 Dec 19 16:50:05 2025"
>
>
> 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: 0x600002e10360>
>
>
>
> 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 Dec 19 16:50:09 2025"
> 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 Dec 19 16:50:11 2025"
>
> ColMode(tmp2)
<pointer: 0x600002e10360>
>
>
>
> ### 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.04322036 -1.46316935 -0.1480288 -0.6699939
[2,] 0.02517756 -2.43637570 2.0351526 0.6766987
[3,] 0.82191162 0.61856574 0.4844441 1.0551255
[4,] -1.09059813 0.05121728 -2.2551260 1.0516564
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 101.04322036 1.46316935 0.1480288 0.6699939
[2,] 0.02517756 2.43637570 2.0351526 0.6766987
[3,] 0.82191162 0.61856574 0.4844441 1.0551255
[4,] 1.09059813 0.05121728 2.2551260 1.0516564
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0520257 1.2096154 0.3847451 0.8185316
[2,] 0.1586744 1.5608894 1.4265877 0.8226170
[3,] 0.9065934 0.7864895 0.6960202 1.0271930
[4,] 1.0443171 0.2263124 1.5017077 1.0255030
>
> 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.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 226.56348 38.55932 28.99548 33.85531
[2,] 26.61192 43.04527 41.30103 33.90287
[3,] 34.88785 33.48346 32.44465 36.32706
[4,] 36.53377 27.31434 42.27220 36.30669
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600002e080c0>
> exp(tmp5)
<pointer: 0x600002e080c0>
> log(tmp5,2)
<pointer: 0x600002e080c0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.5622
> Min(tmp5)
[1] 54.05109
> mean(tmp5)
[1] 72.19459
> Sum(tmp5)
[1] 14438.92
> Var(tmp5)
[1] 874.2452
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.11734 67.33902 68.14912 69.82007 68.25241 70.94122 72.04793 73.97712
[9] 70.19657 70.10512
> rowSums(tmp5)
[1] 1822.347 1346.780 1362.982 1396.401 1365.048 1418.824 1440.959 1479.542
[9] 1403.931 1402.102
> rowVars(tmp5)
[1] 8106.18021 104.31841 45.92860 74.33946 46.81380 56.63469
[7] 80.74809 72.35661 69.91450 44.26018
> rowSd(tmp5)
[1] 90.034328 10.213638 6.777064 8.622033 6.842061 7.525602 8.985994
[8] 8.506269 8.361489 6.652833
> rowMax(tmp5)
[1] 471.56219 89.59309 82.01494 87.98405 79.22375 88.20089 91.41659
[8] 90.20822 89.24101 84.52776
> rowMin(tmp5)
[1] 58.35747 54.70951 55.91512 55.83130 54.34914 60.74058 54.05109 62.28980
[9] 57.77309 54.79380
>
> colMeans(tmp5)
[1] 109.50120 71.29277 72.11601 71.55382 75.36914 68.32288 67.97698
[8] 66.23235 73.76409 72.76006 67.43874 68.68214 66.35837 73.44028
[15] 68.65311 70.20534 69.73487 70.93786 71.71279 67.83905
> colSums(tmp5)
[1] 1095.0120 712.9277 721.1601 715.5382 753.6914 683.2288 679.7698
[8] 662.3235 737.6409 727.6006 674.3874 686.8214 663.5837 734.4028
[15] 686.5311 702.0534 697.3487 709.3786 717.1279 678.3905
> colVars(tmp5)
[1] 16279.58579 134.67945 72.74381 14.02290 46.81358 33.02253
[7] 76.15762 76.01540 57.68551 42.35659 43.52108 68.35072
[13] 25.88871 122.75475 87.68975 111.92868 43.37515 135.29873
[19] 70.08508 23.99975
> colSd(tmp5)
[1] 127.591480 11.605148 8.528998 3.744717 6.842045 5.746523
[7] 8.726834 8.718681 7.595098 6.508194 6.597051 8.267449
[13] 5.088095 11.079474 9.364281 10.579635 6.585982 11.631798
[19] 8.371683 4.898954
> colMax(tmp5)
[1] 471.56219 89.59309 87.98405 77.83318 84.69267 77.21796 79.90118
[8] 82.97169 87.53014 83.88454 75.27224 80.04476 74.17672 89.28055
[15] 82.83851 88.20089 83.67009 91.41659 84.67609 76.13864
> colMin(tmp5)
[1] 54.79380 54.34914 60.35029 66.75847 60.89012 60.74058 54.38961 55.91512
[9] 64.69684 64.32693 57.77309 55.83130 59.08318 60.09924 54.05109 54.70951
[17] 61.64208 58.71003 57.98004 59.66261
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 91.11734 67.33902 68.14912 69.82007 68.25241 70.94122 72.04793 73.97712
[9] NA 70.10512
> rowSums(tmp5)
[1] 1822.347 1346.780 1362.982 1396.401 1365.048 1418.824 1440.959 1479.542
[9] NA 1402.102
> rowVars(tmp5)
[1] 8106.18021 104.31841 45.92860 74.33946 46.81380 56.63469
[7] 80.74809 72.35661 70.91561 44.26018
> rowSd(tmp5)
[1] 90.034328 10.213638 6.777064 8.622033 6.842061 7.525602 8.985994
[8] 8.506269 8.421141 6.652833
> rowMax(tmp5)
[1] 471.56219 89.59309 82.01494 87.98405 79.22375 88.20089 91.41659
[8] 90.20822 NA 84.52776
> rowMin(tmp5)
[1] 58.35747 54.70951 55.91512 55.83130 54.34914 60.74058 54.05109 62.28980
[9] NA 54.79380
>
> colMeans(tmp5)
[1] 109.50120 71.29277 72.11601 71.55382 75.36914 NA 67.97698
[8] 66.23235 73.76409 72.76006 67.43874 68.68214 66.35837 73.44028
[15] 68.65311 70.20534 69.73487 70.93786 71.71279 67.83905
> colSums(tmp5)
[1] 1095.0120 712.9277 721.1601 715.5382 753.6914 NA 679.7698
[8] 662.3235 737.6409 727.6006 674.3874 686.8214 663.5837 734.4028
[15] 686.5311 702.0534 697.3487 709.3786 717.1279 678.3905
> colVars(tmp5)
[1] 16279.58579 134.67945 72.74381 14.02290 46.81358 NA
[7] 76.15762 76.01540 57.68551 42.35659 43.52108 68.35072
[13] 25.88871 122.75475 87.68975 111.92868 43.37515 135.29873
[19] 70.08508 23.99975
> colSd(tmp5)
[1] 127.591480 11.605148 8.528998 3.744717 6.842045 NA
[7] 8.726834 8.718681 7.595098 6.508194 6.597051 8.267449
[13] 5.088095 11.079474 9.364281 10.579635 6.585982 11.631798
[19] 8.371683 4.898954
> colMax(tmp5)
[1] 471.56219 89.59309 87.98405 77.83318 84.69267 NA 79.90118
[8] 82.97169 87.53014 83.88454 75.27224 80.04476 74.17672 89.28055
[15] 82.83851 88.20089 83.67009 91.41659 84.67609 76.13864
> colMin(tmp5)
[1] 54.79380 54.34914 60.35029 66.75847 60.89012 NA 54.38961 55.91512
[9] 64.69684 64.32693 57.77309 55.83130 59.08318 60.09924 54.05109 54.70951
[17] 61.64208 58.71003 57.98004 59.66261
>
> Max(tmp5,na.rm=TRUE)
[1] 471.5622
> Min(tmp5,na.rm=TRUE)
[1] 54.05109
> mean(tmp5,na.rm=TRUE)
[1] 72.16935
> Sum(tmp5,na.rm=TRUE)
[1] 14361.7
> Var(tmp5,na.rm=TRUE)
[1] 878.5325
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.11734 67.33902 68.14912 69.82007 68.25241 70.94122 72.04793 73.97712
[9] 69.82703 70.10512
> rowSums(tmp5,na.rm=TRUE)
[1] 1822.347 1346.780 1362.982 1396.401 1365.048 1418.824 1440.959 1479.542
[9] 1326.714 1402.102
> rowVars(tmp5,na.rm=TRUE)
[1] 8106.18021 104.31841 45.92860 74.33946 46.81380 56.63469
[7] 80.74809 72.35661 70.91561 44.26018
> rowSd(tmp5,na.rm=TRUE)
[1] 90.034328 10.213638 6.777064 8.622033 6.842061 7.525602 8.985994
[8] 8.506269 8.421141 6.652833
> rowMax(tmp5,na.rm=TRUE)
[1] 471.56219 89.59309 82.01494 87.98405 79.22375 88.20089 91.41659
[8] 90.20822 89.24101 84.52776
> rowMin(tmp5,na.rm=TRUE)
[1] 58.35747 54.70951 55.91512 55.83130 54.34914 60.74058 54.05109 62.28980
[9] 57.77309 54.79380
>
> colMeans(tmp5,na.rm=TRUE)
[1] 109.50120 71.29277 72.11601 71.55382 75.36914 67.33454 67.97698
[8] 66.23235 73.76409 72.76006 67.43874 68.68214 66.35837 73.44028
[15] 68.65311 70.20534 69.73487 70.93786 71.71279 67.83905
> colSums(tmp5,na.rm=TRUE)
[1] 1095.0120 712.9277 721.1601 715.5382 753.6914 606.0108 679.7698
[8] 662.3235 737.6409 727.6006 674.3874 686.8214 663.5837 734.4028
[15] 686.5311 702.0534 697.3487 709.3786 717.1279 678.3905
> colVars(tmp5,na.rm=TRUE)
[1] 16279.58579 134.67945 72.74381 14.02290 46.81358 26.16111
[7] 76.15762 76.01540 57.68551 42.35659 43.52108 68.35072
[13] 25.88871 122.75475 87.68975 111.92868 43.37515 135.29873
[19] 70.08508 23.99975
> colSd(tmp5,na.rm=TRUE)
[1] 127.591480 11.605148 8.528998 3.744717 6.842045 5.114794
[7] 8.726834 8.718681 7.595098 6.508194 6.597051 8.267449
[13] 5.088095 11.079474 9.364281 10.579635 6.585982 11.631798
[19] 8.371683 4.898954
> colMax(tmp5,na.rm=TRUE)
[1] 471.56219 89.59309 87.98405 77.83318 84.69267 74.63378 79.90118
[8] 82.97169 87.53014 83.88454 75.27224 80.04476 74.17672 89.28055
[15] 82.83851 88.20089 83.67009 91.41659 84.67609 76.13864
> colMin(tmp5,na.rm=TRUE)
[1] 54.79380 54.34914 60.35029 66.75847 60.89012 60.74058 54.38961 55.91512
[9] 64.69684 64.32693 57.77309 55.83130 59.08318 60.09924 54.05109 54.70951
[17] 61.64208 58.71003 57.98004 59.66261
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.11734 67.33902 68.14912 69.82007 68.25241 70.94122 72.04793 73.97712
[9] NaN 70.10512
> rowSums(tmp5,na.rm=TRUE)
[1] 1822.347 1346.780 1362.982 1396.401 1365.048 1418.824 1440.959 1479.542
[9] 0.000 1402.102
> rowVars(tmp5,na.rm=TRUE)
[1] 8106.18021 104.31841 45.92860 74.33946 46.81380 56.63469
[7] 80.74809 72.35661 NA 44.26018
> rowSd(tmp5,na.rm=TRUE)
[1] 90.034328 10.213638 6.777064 8.622033 6.842061 7.525602 8.985994
[8] 8.506269 NA 6.652833
> rowMax(tmp5,na.rm=TRUE)
[1] 471.56219 89.59309 82.01494 87.98405 79.22375 88.20089 91.41659
[8] 90.20822 NA 84.52776
> rowMin(tmp5,na.rm=TRUE)
[1] 58.35747 54.70951 55.91512 55.83130 54.34914 60.74058 54.05109 62.28980
[9] NA 54.79380
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 114.61396 71.62223 72.27025 70.85612 75.50100 NaN 66.95530
[8] 66.53764 72.83487 73.69708 68.51271 67.48485 65.62104 71.68465
[15] 68.98923 70.75999 69.75501 72.29650 72.66265 68.34229
> colSums(tmp5,na.rm=TRUE)
[1] 1031.5256 644.6000 650.4322 637.7050 679.5090 0.0000 602.5977
[8] 598.8387 655.5138 663.2737 616.6144 607.3637 590.5894 645.1618
[15] 620.9031 636.8399 627.7951 650.6685 653.9639 615.0806
> colVars(tmp5,na.rm=TRUE)
[1] 18020.45541 150.29329 81.56915 10.29933 52.46968 NA
[7] 73.93417 84.46882 55.18228 37.77371 35.98553 60.76758
[13] 23.00875 103.42369 97.37992 122.45883 48.79248 131.44445
[19] 68.69546 24.15069
> colSd(tmp5,na.rm=TRUE)
[1] 134.240290 12.259416 9.031564 3.209256 7.243596 NA
[7] 8.598498 9.190692 7.428477 6.146032 5.998794 7.795356
[13] 4.796744 10.169744 9.868127 11.066112 6.985162 11.464923
[19] 8.288272 4.914335
> colMax(tmp5,na.rm=TRUE)
[1] 471.56219 89.59309 87.98405 75.61001 84.69267 -Inf 79.90118
[8] 82.97169 87.53014 83.88454 75.27224 80.04476 74.17672 89.28055
[15] 82.83851 88.20089 83.67009 91.41659 84.67609 76.13864
> colMin(tmp5,na.rm=TRUE)
[1] 54.79380 54.34914 60.35029 66.75847 60.89012 Inf 54.38961 55.91512
[9] 64.69684 64.75970 57.90962 55.83130 59.08318 60.09924 54.05109 54.70951
[17] 61.64208 61.87098 57.98004 59.66261
>
>
>
>
> 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] 279.4632 104.4115 297.4305 106.8500 311.0819 173.1064 212.9017 210.2561
[9] 185.1986 236.6628
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 279.4632 104.4115 297.4305 106.8500 311.0819 173.1064 212.9017 210.2561
[9] 185.1986 236.6628
>
>
>
> 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] -8.526513e-14 0.000000e+00 -5.684342e-14 5.684342e-14 -5.684342e-14
[6] 0.000000e+00 2.842171e-14 8.526513e-14 -4.263256e-14 0.000000e+00
[11] 4.263256e-14 -1.705303e-13 7.105427e-15 -8.526513e-14 2.842171e-14
[16] -5.684342e-14 -1.136868e-13 -1.421085e-13 1.421085e-14 -1.705303e-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)
+ }
4 6
3 17
2 4
1 5
6 13
5 7
8 16
10 19
10 3
8 10
4 7
2 2
1 15
2 7
2 15
5 3
3 8
9 2
4 8
8 6
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.537787
> Min(tmp)
[1] -2.071177
> mean(tmp)
[1] 0.02910316
> Sum(tmp)
[1] 2.910316
> Var(tmp)
[1] 1.015723
>
> rowMeans(tmp)
[1] 0.02910316
> rowSums(tmp)
[1] 2.910316
> rowVars(tmp)
[1] 1.015723
> rowSd(tmp)
[1] 1.007831
> rowMax(tmp)
[1] 2.537787
> rowMin(tmp)
[1] -2.071177
>
> colMeans(tmp)
[1] 0.42093198 1.47947255 -0.15005010 -2.07117664 1.17813760 -1.09479443
[7] 0.25471850 1.27916581 -0.77146733 -0.08421646 -0.31496199 -0.09436927
[13] 0.05704496 -0.35263820 1.61722341 -0.54364708 1.26685130 2.43134754
[19] 0.32250727 -0.44168539 -0.41493714 -1.92054846 1.10280281 -0.66163786
[25] 0.88334148 1.39681005 -1.55421422 -0.62232188 -1.05797597 -0.53020781
[31] 2.53778745 -0.40166239 0.53819843 0.43269503 1.80233734 0.31215570
[37] 0.91531223 -0.02782643 -0.53453881 -1.15298838 0.04383568 -0.87897685
[43] -1.48096132 -1.68629571 0.88309010 0.68472461 1.79878582 -0.11946749
[49] 1.90142366 -0.77885682 0.76196711 -0.64295774 -0.05627857 -0.46686490
[55] 0.47315074 0.34964438 0.13225001 0.27223883 -0.26551545 0.04695332
[61] -0.54199931 -0.41098162 0.38929339 0.16529788 0.06919248 -0.01448413
[67] -0.60074127 1.54440325 -0.37581080 -1.86109091 0.65944058 0.61668753
[73] -1.01326632 -1.31995533 -1.36824442 0.02130497 -0.99821651 -0.33626261
[79] -1.01444366 0.73336364 -0.42805981 0.44834064 1.37801841 -1.30003371
[85] 0.44136914 -1.33755803 0.11983249 -0.24129517 -0.80080254 0.22341306
[91] 1.63543704 0.81621831 -0.81605170 -0.85950634 1.69755513 1.32854411
[97] 1.75397168 -1.40840850 -0.47088295 -0.01613636
> colSums(tmp)
[1] 0.42093198 1.47947255 -0.15005010 -2.07117664 1.17813760 -1.09479443
[7] 0.25471850 1.27916581 -0.77146733 -0.08421646 -0.31496199 -0.09436927
[13] 0.05704496 -0.35263820 1.61722341 -0.54364708 1.26685130 2.43134754
[19] 0.32250727 -0.44168539 -0.41493714 -1.92054846 1.10280281 -0.66163786
[25] 0.88334148 1.39681005 -1.55421422 -0.62232188 -1.05797597 -0.53020781
[31] 2.53778745 -0.40166239 0.53819843 0.43269503 1.80233734 0.31215570
[37] 0.91531223 -0.02782643 -0.53453881 -1.15298838 0.04383568 -0.87897685
[43] -1.48096132 -1.68629571 0.88309010 0.68472461 1.79878582 -0.11946749
[49] 1.90142366 -0.77885682 0.76196711 -0.64295774 -0.05627857 -0.46686490
[55] 0.47315074 0.34964438 0.13225001 0.27223883 -0.26551545 0.04695332
[61] -0.54199931 -0.41098162 0.38929339 0.16529788 0.06919248 -0.01448413
[67] -0.60074127 1.54440325 -0.37581080 -1.86109091 0.65944058 0.61668753
[73] -1.01326632 -1.31995533 -1.36824442 0.02130497 -0.99821651 -0.33626261
[79] -1.01444366 0.73336364 -0.42805981 0.44834064 1.37801841 -1.30003371
[85] 0.44136914 -1.33755803 0.11983249 -0.24129517 -0.80080254 0.22341306
[91] 1.63543704 0.81621831 -0.81605170 -0.85950634 1.69755513 1.32854411
[97] 1.75397168 -1.40840850 -0.47088295 -0.01613636
> 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.42093198 1.47947255 -0.15005010 -2.07117664 1.17813760 -1.09479443
[7] 0.25471850 1.27916581 -0.77146733 -0.08421646 -0.31496199 -0.09436927
[13] 0.05704496 -0.35263820 1.61722341 -0.54364708 1.26685130 2.43134754
[19] 0.32250727 -0.44168539 -0.41493714 -1.92054846 1.10280281 -0.66163786
[25] 0.88334148 1.39681005 -1.55421422 -0.62232188 -1.05797597 -0.53020781
[31] 2.53778745 -0.40166239 0.53819843 0.43269503 1.80233734 0.31215570
[37] 0.91531223 -0.02782643 -0.53453881 -1.15298838 0.04383568 -0.87897685
[43] -1.48096132 -1.68629571 0.88309010 0.68472461 1.79878582 -0.11946749
[49] 1.90142366 -0.77885682 0.76196711 -0.64295774 -0.05627857 -0.46686490
[55] 0.47315074 0.34964438 0.13225001 0.27223883 -0.26551545 0.04695332
[61] -0.54199931 -0.41098162 0.38929339 0.16529788 0.06919248 -0.01448413
[67] -0.60074127 1.54440325 -0.37581080 -1.86109091 0.65944058 0.61668753
[73] -1.01326632 -1.31995533 -1.36824442 0.02130497 -0.99821651 -0.33626261
[79] -1.01444366 0.73336364 -0.42805981 0.44834064 1.37801841 -1.30003371
[85] 0.44136914 -1.33755803 0.11983249 -0.24129517 -0.80080254 0.22341306
[91] 1.63543704 0.81621831 -0.81605170 -0.85950634 1.69755513 1.32854411
[97] 1.75397168 -1.40840850 -0.47088295 -0.01613636
> colMin(tmp)
[1] 0.42093198 1.47947255 -0.15005010 -2.07117664 1.17813760 -1.09479443
[7] 0.25471850 1.27916581 -0.77146733 -0.08421646 -0.31496199 -0.09436927
[13] 0.05704496 -0.35263820 1.61722341 -0.54364708 1.26685130 2.43134754
[19] 0.32250727 -0.44168539 -0.41493714 -1.92054846 1.10280281 -0.66163786
[25] 0.88334148 1.39681005 -1.55421422 -0.62232188 -1.05797597 -0.53020781
[31] 2.53778745 -0.40166239 0.53819843 0.43269503 1.80233734 0.31215570
[37] 0.91531223 -0.02782643 -0.53453881 -1.15298838 0.04383568 -0.87897685
[43] -1.48096132 -1.68629571 0.88309010 0.68472461 1.79878582 -0.11946749
[49] 1.90142366 -0.77885682 0.76196711 -0.64295774 -0.05627857 -0.46686490
[55] 0.47315074 0.34964438 0.13225001 0.27223883 -0.26551545 0.04695332
[61] -0.54199931 -0.41098162 0.38929339 0.16529788 0.06919248 -0.01448413
[67] -0.60074127 1.54440325 -0.37581080 -1.86109091 0.65944058 0.61668753
[73] -1.01326632 -1.31995533 -1.36824442 0.02130497 -0.99821651 -0.33626261
[79] -1.01444366 0.73336364 -0.42805981 0.44834064 1.37801841 -1.30003371
[85] 0.44136914 -1.33755803 0.11983249 -0.24129517 -0.80080254 0.22341306
[91] 1.63543704 0.81621831 -0.81605170 -0.85950634 1.69755513 1.32854411
[97] 1.75397168 -1.40840850 -0.47088295 -0.01613636
> colMedians(tmp)
[1] 0.42093198 1.47947255 -0.15005010 -2.07117664 1.17813760 -1.09479443
[7] 0.25471850 1.27916581 -0.77146733 -0.08421646 -0.31496199 -0.09436927
[13] 0.05704496 -0.35263820 1.61722341 -0.54364708 1.26685130 2.43134754
[19] 0.32250727 -0.44168539 -0.41493714 -1.92054846 1.10280281 -0.66163786
[25] 0.88334148 1.39681005 -1.55421422 -0.62232188 -1.05797597 -0.53020781
[31] 2.53778745 -0.40166239 0.53819843 0.43269503 1.80233734 0.31215570
[37] 0.91531223 -0.02782643 -0.53453881 -1.15298838 0.04383568 -0.87897685
[43] -1.48096132 -1.68629571 0.88309010 0.68472461 1.79878582 -0.11946749
[49] 1.90142366 -0.77885682 0.76196711 -0.64295774 -0.05627857 -0.46686490
[55] 0.47315074 0.34964438 0.13225001 0.27223883 -0.26551545 0.04695332
[61] -0.54199931 -0.41098162 0.38929339 0.16529788 0.06919248 -0.01448413
[67] -0.60074127 1.54440325 -0.37581080 -1.86109091 0.65944058 0.61668753
[73] -1.01326632 -1.31995533 -1.36824442 0.02130497 -0.99821651 -0.33626261
[79] -1.01444366 0.73336364 -0.42805981 0.44834064 1.37801841 -1.30003371
[85] 0.44136914 -1.33755803 0.11983249 -0.24129517 -0.80080254 0.22341306
[91] 1.63543704 0.81621831 -0.81605170 -0.85950634 1.69755513 1.32854411
[97] 1.75397168 -1.40840850 -0.47088295 -0.01613636
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.420932 1.479473 -0.1500501 -2.071177 1.178138 -1.094794 0.2547185
[2,] 0.420932 1.479473 -0.1500501 -2.071177 1.178138 -1.094794 0.2547185
[,8] [,9] [,10] [,11] [,12] [,13]
[1,] 1.279166 -0.7714673 -0.08421646 -0.314962 -0.09436927 0.05704496
[2,] 1.279166 -0.7714673 -0.08421646 -0.314962 -0.09436927 0.05704496
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] -0.3526382 1.617223 -0.5436471 1.266851 2.431348 0.3225073 -0.4416854
[2,] -0.3526382 1.617223 -0.5436471 1.266851 2.431348 0.3225073 -0.4416854
[,21] [,22] [,23] [,24] [,25] [,26] [,27]
[1,] -0.4149371 -1.920548 1.102803 -0.6616379 0.8833415 1.39681 -1.554214
[2,] -0.4149371 -1.920548 1.102803 -0.6616379 0.8833415 1.39681 -1.554214
[,28] [,29] [,30] [,31] [,32] [,33] [,34]
[1,] -0.6223219 -1.057976 -0.5302078 2.537787 -0.4016624 0.5381984 0.432695
[2,] -0.6223219 -1.057976 -0.5302078 2.537787 -0.4016624 0.5381984 0.432695
[,35] [,36] [,37] [,38] [,39] [,40] [,41]
[1,] 1.802337 0.3121557 0.9153122 -0.02782643 -0.5345388 -1.152988 0.04383568
[2,] 1.802337 0.3121557 0.9153122 -0.02782643 -0.5345388 -1.152988 0.04383568
[,42] [,43] [,44] [,45] [,46] [,47] [,48]
[1,] -0.8789768 -1.480961 -1.686296 0.8830901 0.6847246 1.798786 -0.1194675
[2,] -0.8789768 -1.480961 -1.686296 0.8830901 0.6847246 1.798786 -0.1194675
[,49] [,50] [,51] [,52] [,53] [,54] [,55]
[1,] 1.901424 -0.7788568 0.7619671 -0.6429577 -0.05627857 -0.4668649 0.4731507
[2,] 1.901424 -0.7788568 0.7619671 -0.6429577 -0.05627857 -0.4668649 0.4731507
[,56] [,57] [,58] [,59] [,60] [,61] [,62]
[1,] 0.3496444 0.13225 0.2722388 -0.2655154 0.04695332 -0.5419993 -0.4109816
[2,] 0.3496444 0.13225 0.2722388 -0.2655154 0.04695332 -0.5419993 -0.4109816
[,63] [,64] [,65] [,66] [,67] [,68] [,69]
[1,] 0.3892934 0.1652979 0.06919248 -0.01448413 -0.6007413 1.544403 -0.3758108
[2,] 0.3892934 0.1652979 0.06919248 -0.01448413 -0.6007413 1.544403 -0.3758108
[,70] [,71] [,72] [,73] [,74] [,75] [,76]
[1,] -1.861091 0.6594406 0.6166875 -1.013266 -1.319955 -1.368244 0.02130497
[2,] -1.861091 0.6594406 0.6166875 -1.013266 -1.319955 -1.368244 0.02130497
[,77] [,78] [,79] [,80] [,81] [,82] [,83]
[1,] -0.9982165 -0.3362626 -1.014444 0.7333636 -0.4280598 0.4483406 1.378018
[2,] -0.9982165 -0.3362626 -1.014444 0.7333636 -0.4280598 0.4483406 1.378018
[,84] [,85] [,86] [,87] [,88] [,89] [,90]
[1,] -1.300034 0.4413691 -1.337558 0.1198325 -0.2412952 -0.8008025 0.2234131
[2,] -1.300034 0.4413691 -1.337558 0.1198325 -0.2412952 -0.8008025 0.2234131
[,91] [,92] [,93] [,94] [,95] [,96] [,97]
[1,] 1.635437 0.8162183 -0.8160517 -0.8595063 1.697555 1.328544 1.753972
[2,] 1.635437 0.8162183 -0.8160517 -0.8595063 1.697555 1.328544 1.753972
[,98] [,99] [,100]
[1,] -1.408408 -0.4708829 -0.01613636
[2,] -1.408408 -0.4708829 -0.01613636
>
>
> Max(tmp2)
[1] 2.572446
> Min(tmp2)
[1] -2.529547
> mean(tmp2)
[1] 0.05958021
> Sum(tmp2)
[1] 5.958021
> Var(tmp2)
[1] 1.17092
>
> rowMeans(tmp2)
[1] -1.564643428 1.540092834 0.580169736 -0.477635699 2.388796964
[6] -0.063560042 0.319859244 0.672511683 1.252909044 -0.082140856
[11] 0.856754012 2.572446381 0.509016637 0.461117114 -1.710661710
[16] -0.551585584 -0.197995952 0.865796332 -1.640673964 -0.148289944
[21] 1.786943844 -2.529547157 0.876082025 -0.448599431 -0.231992105
[26] 0.182808018 -0.824463740 1.478297450 0.244698304 -1.051366828
[31] 0.212870915 -1.562717643 -0.699123387 0.835512779 0.612417251
[36] 1.052802652 0.579261903 0.551814433 -0.123867928 -1.895468463
[41] 0.733863664 0.454688836 0.202874464 -0.623014031 2.114772382
[46] 0.873506537 1.541063870 2.192694539 0.464298953 -1.980586288
[51] 1.656733297 -0.103918612 0.697104835 0.852190254 -0.047583749
[56] -0.877582988 1.458426471 -0.397557638 1.806565016 0.735667690
[61] 0.224014836 -0.111429391 0.197547071 0.007613992 -0.584887118
[66] 0.298465528 1.323947429 -0.984555527 -0.842899752 -0.940963766
[71] -0.775658004 1.782891038 -1.314234166 0.545852916 -1.431623481
[76] 0.976848397 0.391216335 0.781730876 -0.564144113 0.847692958
[81] -1.633121406 0.457392631 0.218214938 -0.456439686 -0.223599868
[86] -1.214194175 -0.542974954 -1.080734931 0.125427174 -1.099005476
[91] -1.501260125 -0.199098104 -1.371568862 1.158610620 1.400327496
[96] -1.344600472 -1.036251346 -0.720455047 0.259539237 -1.448465688
> rowSums(tmp2)
[1] -1.564643428 1.540092834 0.580169736 -0.477635699 2.388796964
[6] -0.063560042 0.319859244 0.672511683 1.252909044 -0.082140856
[11] 0.856754012 2.572446381 0.509016637 0.461117114 -1.710661710
[16] -0.551585584 -0.197995952 0.865796332 -1.640673964 -0.148289944
[21] 1.786943844 -2.529547157 0.876082025 -0.448599431 -0.231992105
[26] 0.182808018 -0.824463740 1.478297450 0.244698304 -1.051366828
[31] 0.212870915 -1.562717643 -0.699123387 0.835512779 0.612417251
[36] 1.052802652 0.579261903 0.551814433 -0.123867928 -1.895468463
[41] 0.733863664 0.454688836 0.202874464 -0.623014031 2.114772382
[46] 0.873506537 1.541063870 2.192694539 0.464298953 -1.980586288
[51] 1.656733297 -0.103918612 0.697104835 0.852190254 -0.047583749
[56] -0.877582988 1.458426471 -0.397557638 1.806565016 0.735667690
[61] 0.224014836 -0.111429391 0.197547071 0.007613992 -0.584887118
[66] 0.298465528 1.323947429 -0.984555527 -0.842899752 -0.940963766
[71] -0.775658004 1.782891038 -1.314234166 0.545852916 -1.431623481
[76] 0.976848397 0.391216335 0.781730876 -0.564144113 0.847692958
[81] -1.633121406 0.457392631 0.218214938 -0.456439686 -0.223599868
[86] -1.214194175 -0.542974954 -1.080734931 0.125427174 -1.099005476
[91] -1.501260125 -0.199098104 -1.371568862 1.158610620 1.400327496
[96] -1.344600472 -1.036251346 -0.720455047 0.259539237 -1.448465688
> 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.564643428 1.540092834 0.580169736 -0.477635699 2.388796964
[6] -0.063560042 0.319859244 0.672511683 1.252909044 -0.082140856
[11] 0.856754012 2.572446381 0.509016637 0.461117114 -1.710661710
[16] -0.551585584 -0.197995952 0.865796332 -1.640673964 -0.148289944
[21] 1.786943844 -2.529547157 0.876082025 -0.448599431 -0.231992105
[26] 0.182808018 -0.824463740 1.478297450 0.244698304 -1.051366828
[31] 0.212870915 -1.562717643 -0.699123387 0.835512779 0.612417251
[36] 1.052802652 0.579261903 0.551814433 -0.123867928 -1.895468463
[41] 0.733863664 0.454688836 0.202874464 -0.623014031 2.114772382
[46] 0.873506537 1.541063870 2.192694539 0.464298953 -1.980586288
[51] 1.656733297 -0.103918612 0.697104835 0.852190254 -0.047583749
[56] -0.877582988 1.458426471 -0.397557638 1.806565016 0.735667690
[61] 0.224014836 -0.111429391 0.197547071 0.007613992 -0.584887118
[66] 0.298465528 1.323947429 -0.984555527 -0.842899752 -0.940963766
[71] -0.775658004 1.782891038 -1.314234166 0.545852916 -1.431623481
[76] 0.976848397 0.391216335 0.781730876 -0.564144113 0.847692958
[81] -1.633121406 0.457392631 0.218214938 -0.456439686 -0.223599868
[86] -1.214194175 -0.542974954 -1.080734931 0.125427174 -1.099005476
[91] -1.501260125 -0.199098104 -1.371568862 1.158610620 1.400327496
[96] -1.344600472 -1.036251346 -0.720455047 0.259539237 -1.448465688
> rowMin(tmp2)
[1] -1.564643428 1.540092834 0.580169736 -0.477635699 2.388796964
[6] -0.063560042 0.319859244 0.672511683 1.252909044 -0.082140856
[11] 0.856754012 2.572446381 0.509016637 0.461117114 -1.710661710
[16] -0.551585584 -0.197995952 0.865796332 -1.640673964 -0.148289944
[21] 1.786943844 -2.529547157 0.876082025 -0.448599431 -0.231992105
[26] 0.182808018 -0.824463740 1.478297450 0.244698304 -1.051366828
[31] 0.212870915 -1.562717643 -0.699123387 0.835512779 0.612417251
[36] 1.052802652 0.579261903 0.551814433 -0.123867928 -1.895468463
[41] 0.733863664 0.454688836 0.202874464 -0.623014031 2.114772382
[46] 0.873506537 1.541063870 2.192694539 0.464298953 -1.980586288
[51] 1.656733297 -0.103918612 0.697104835 0.852190254 -0.047583749
[56] -0.877582988 1.458426471 -0.397557638 1.806565016 0.735667690
[61] 0.224014836 -0.111429391 0.197547071 0.007613992 -0.584887118
[66] 0.298465528 1.323947429 -0.984555527 -0.842899752 -0.940963766
[71] -0.775658004 1.782891038 -1.314234166 0.545852916 -1.431623481
[76] 0.976848397 0.391216335 0.781730876 -0.564144113 0.847692958
[81] -1.633121406 0.457392631 0.218214938 -0.456439686 -0.223599868
[86] -1.214194175 -0.542974954 -1.080734931 0.125427174 -1.099005476
[91] -1.501260125 -0.199098104 -1.371568862 1.158610620 1.400327496
[96] -1.344600472 -1.036251346 -0.720455047 0.259539237 -1.448465688
>
> colMeans(tmp2)
[1] 0.05958021
> colSums(tmp2)
[1] 5.958021
> colVars(tmp2)
[1] 1.17092
> colSd(tmp2)
[1] 1.08209
> colMax(tmp2)
[1] 2.572446
> colMin(tmp2)
[1] -2.529547
> colMedians(tmp2)
[1] 0.1901775
> colRanges(tmp2)
[,1]
[1,] -2.529547
[2,] 2.572446
>
> 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.6833373 0.5084227 1.0646900 5.3854583 2.9939151 -3.3172271
[7] 3.1321801 7.8651529 3.9790051 -2.3516896
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.0678721
[2,] -0.1759964
[3,] 0.4060616
[4,] 0.9193993
[5,] 1.2665358
>
> rowApply(tmp,sum)
[1] 0.6892991 1.4121582 0.1357630 2.0599097 1.0168583 -0.9800465
[7] 6.6053548 3.8584961 3.3675592 2.7778928
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 6 5 5 1 8 9 1 6 7 8
[2,] 8 2 2 3 7 5 3 7 10 2
[3,] 4 7 9 8 2 4 4 8 1 10
[4,] 9 6 7 7 9 6 9 3 5 7
[5,] 5 3 3 6 4 3 10 10 8 6
[6,] 2 1 6 4 1 2 8 9 2 3
[7,] 10 4 4 5 5 7 2 4 6 9
[8,] 7 10 8 9 10 10 7 2 3 4
[9,] 3 9 10 10 6 8 6 1 4 5
[10,] 1 8 1 2 3 1 5 5 9 1
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -6.22870727 -2.37403495 0.42296283 -1.74023500 -2.87600702 4.11989362
[7] 0.94502678 1.19337268 -0.08701888 -1.73294048 -3.46227028 -2.57806278
[13] 2.48174052 1.74274233 -1.26710447 -1.11356315 1.05133967 2.40589334
[19] -2.75509640 -0.35526232
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.6096800
[2,] -1.5220797
[3,] -1.2153757
[4,] -1.1503789
[5,] -0.7311929
>
> rowApply(tmp,sum)
[1] -2.887628 2.809537 -3.862803 -3.649710 -4.616727
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 2 4 3 3 5
[2,] 1 6 13 14 17
[3,] 8 13 12 7 20
[4,] 11 1 18 13 3
[5,] 18 12 8 1 4
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -1.5220797 -2.51124072 -0.2570953 0.1401511 0.7175367 0.9662394
[2,] -1.1503789 -0.59696856 0.6958651 -1.4283283 0.5584146 0.4662688
[3,] -1.2153757 -0.09880312 -0.1828695 0.8487279 -0.5239228 0.9449717
[4,] -1.6096800 0.42616634 -1.1078821 0.1438561 -2.4007853 1.3835816
[5,] -0.7311929 0.40681111 1.2749446 -1.4446418 -1.2272502 0.3588321
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.03693868 0.36970475 -0.4559302 -0.5830059 -0.4916513 0.2294308
[2,] 0.06411053 0.77419702 1.4021637 1.4087918 0.7381331 -1.3410748
[3,] 0.47359102 -0.77454914 -0.5298185 0.8281714 -0.9648006 -1.6853292
[4,] 0.08838815 -0.08428611 -0.3563019 -1.4592960 -0.5997797 0.7281694
[5,] 0.35587576 0.90830615 -0.1471320 -1.9276017 -2.1441718 -0.5092590
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.8537455 -0.02419408 0.65701162 -0.73120859 0.2539010 0.24344894
[2,] 1.0483068 0.01371808 -0.05359003 1.14695216 -0.2773764 -0.76752997
[3,] -0.5305656 0.49510072 -0.38980002 -1.62388514 -0.3961905 -0.01814464
[4,] 0.8720692 1.37047183 -1.22733415 -0.09404032 0.4286893 3.27180029
[5,] 0.2381846 -0.11235423 -0.25339189 0.18861874 1.0423162 -0.32368129
[,19] [,20]
[1,] -1.4189317 0.7134779992
[2,] -1.2728643 1.3807266340
[3,] 1.9457904 -0.4651017347
[4,] -1.4384541 -1.9850625548
[5,] -0.5706366 0.0006973323
>
>
> 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.22-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.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 655 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 567 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.22-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.503369 -0.7954732 -1.225438 -0.03883787 -0.6615571 0.3638336 1.266077
col8 col9 col10 col11 col12 col13 col14
row1 -0.7703712 -1.170157 -1.062013 1.822146 0.05012654 0.6657544 0.8876254
col15 col16 col17 col18 col19 col20
row1 -0.2140854 -1.76187 0.1164011 1.094655 -0.1602383 -1.188098
> tmp[,"col10"]
col10
row1 -1.0620131
row2 -1.2068755
row3 1.1106758
row4 -0.3472405
row5 -1.0906185
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -0.5033690 -0.7954732 -1.225438 -0.03883787 -0.66155709 0.3638336
row5 -0.3535439 -0.8482026 0.287043 -0.65285745 0.07916839 0.4260147
col7 col8 col9 col10 col11 col12 col13
row1 1.2660774 -0.77037121 -1.170157 -1.062013 1.822146 0.05012654 0.6657544
row5 -0.3893403 -0.01612281 -1.794412 -1.090618 1.412120 0.22227361 -0.3639943
col14 col15 col16 col17 col18 col19 col20
row1 0.8876254 -0.2140854 -1.761870 0.1164011 1.094655 -0.1602383 -1.188097538
row5 0.3831744 -2.0044423 -1.855345 -0.3396536 1.256130 0.1250686 -0.008860171
> tmp[,c("col6","col20")]
col6 col20
row1 0.3638336 -1.188097538
row2 -1.0695313 -0.170558284
row3 2.1164573 -0.925916383
row4 1.0000885 0.190002310
row5 0.4260147 -0.008860171
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.3638336 -1.188097538
row5 0.4260147 -0.008860171
>
>
>
>
> 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 48.0306 50.09464 50.06262 50.9511 49.32473 104.3786 50.76983 48.07468
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.5622 50.87154 51.94593 48.98064 49.9537 49.07273 51.8996 50.98473
col17 col18 col19 col20
row1 50.60705 51.01087 49.53596 105.8998
> tmp[,"col10"]
col10
row1 50.87154
row2 29.87998
row3 31.41144
row4 31.26644
row5 49.97691
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.03060 50.09464 50.06262 50.95110 49.32473 104.3786 50.76983 48.07468
row5 49.74685 49.28811 49.93950 49.30837 49.81105 105.2140 49.98648 50.41115
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.56220 50.87154 51.94593 48.98064 49.95370 49.07273 51.89960 50.98473
row5 49.93419 49.97691 49.10384 51.03334 50.16872 50.19777 50.10346 49.21315
col17 col18 col19 col20
row1 50.60705 51.01087 49.53596 105.8998
row5 50.92545 49.68447 50.38024 106.9518
> tmp[,c("col6","col20")]
col6 col20
row1 104.37856 105.89984
row2 75.16397 73.76889
row3 74.68506 72.45139
row4 77.07532 74.24344
row5 105.21400 106.95179
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.3786 105.8998
row5 105.2140 106.9518
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.3786 105.8998
row5 105.2140 106.9518
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.6845460
[2,] 0.3296671
[3,] -2.1494801
[4,] 2.6217820
[5,] -0.8919200
> tmp[,c("col17","col7")]
col17 col7
[1,] -1.7173251 0.7097553
[2,] 0.2386544 0.6791756
[3,] -0.9206927 0.5392830
[4,] 0.6051114 1.4627699
[5,] -1.5096512 0.3893624
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 3.0820995 -1.0992400
[2,] 0.2953109 -0.6307193
[3,] -0.1153016 -2.1602512
[4,] -0.8780676 0.2507021
[5,] 1.3610336 0.5703641
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 3.082099
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 3.0820995
[2,] 0.2953109
>
>
>
> 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 1.663537 0.1590646 -1.3332825 0.3247687 0.3361125 -0.65503014 1.201161
row1 1.130753 0.3888664 -0.5542223 0.1160501 -0.3964033 0.03059665 -1.040889
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 -0.8508581 -0.232477 0.4062227 0.2745126 0.6073211 0.9499837 -0.6564861
row1 1.3099497 -2.687050 3.1121772 0.3968539 0.3534619 -2.8998548 -0.1983992
[,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.4186961 0.4597883 0.02056024 0.6559649 0.3435453 0.0635988
row1 -1.0965007 0.2996066 0.69562833 -2.1183640 0.7775395 0.4321729
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.1099914 0.5679595 -1.421621 -0.5528083 -2.838971 -0.04446172 0.09632038
[,8] [,9] [,10]
row2 0.2125004 -0.7341136 -0.06924109
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
row5 0.6345941 0.466303 1.191382 1.42995 -1.73818 -1.044968 -1.625807 -0.197658
[,9] [,10] [,11] [,12] [,13] [,14] [,15]
row5 -1.239842 -1.904413 0.5091228 -0.6736879 -0.2561054 0.05183097 1.059914
[,16] [,17] [,18] [,19] [,20]
row5 -0.2530707 -1.093557 1.155376 1.329582 -0.4477508
>
>
> 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: 0x600002e08240>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM125f77f734cc7"
[2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM125f76ab5de2f"
[3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM125f74a0e1664"
[4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM125f762e02537"
[5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM125f769ab7097"
[6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM125f7766cffb3"
[7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM125f76e077d82"
[8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM125f72dc11a3d"
[9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM125f760a1b242"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM125f717be3c9e"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM125f74a7db53f"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM125f7306614e"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM125f717de496f"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM125f72a722a7"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM125f72ad4034d"
>
>
> ### 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: 0x600002e0c1e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600002e0c1e0>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x600002e0c1e0>
> rowMedians(tmp)
[1] 0.4579069659 -0.2622794922 0.2976937408 0.3050436309 -0.2488868054
[6] -0.0383421697 -0.0895351148 -0.3071038520 -0.4667600206 0.4243959927
[11] -0.3102589489 0.1076373397 -0.3165248418 -0.1058809478 0.2448050818
[16] -0.0311867250 0.0034374635 0.5998145080 -0.1547932485 -0.3645782752
[21] -0.1890595741 0.2305527143 -0.3812606991 0.2453655062 -0.1385647180
[26] -0.1928703864 0.0282639413 0.3397364598 -0.1665556486 -0.1256986155
[31] -0.1148574541 -0.4634676582 0.4075572339 -0.0368105148 -0.5762904984
[36] -0.0894334705 0.4216853008 -0.1466828066 -0.0238037425 0.0668064868
[41] -0.6229641708 0.0063954929 -0.0674800200 0.4782108572 -0.2154207348
[46] 0.2006076917 -0.1366594328 0.3475759818 0.0198584346 -0.1372622959
[51] -0.3334295444 0.0052550534 0.0815092003 0.1071673403 0.0114611716
[56] -0.1019276453 -0.5968450090 -0.2414113351 -0.0053374349 -0.0074842842
[61] 0.1216776743 -0.8203217301 -0.1750772153 0.3016036808 -0.0972814804
[66] 0.1153499158 0.1453069471 -0.1843169600 -0.1043665100 0.3231050821
[71] 0.1445500447 0.3566435574 -0.6048160097 -0.4571093379 -0.0139219857
[76] -0.1771677921 0.7374012062 -0.6283487115 -0.1596356718 -0.2322703827
[81] 0.2015968921 0.9959032422 0.3392257082 0.8008004210 -0.4117216801
[86] 0.4311273016 -0.4607180411 -0.2207475330 0.3755996153 0.0076112077
[91] 0.1798552875 -0.1421213839 0.3910466669 0.6295804930 0.9442723956
[96] -0.0435672970 -0.1353592804 -0.3385055038 -0.0324191790 0.1492862705
[101] -0.6326143004 -0.4126041187 0.1015540546 0.0787742899 0.3164168776
[106] -0.5746929916 0.3754805349 -0.2632059782 0.0045392734 -0.4206255727
[111] -0.0615277867 0.1462304232 0.5422597055 -0.1876025836 0.4777726699
[116] 0.1260476204 0.0633759099 0.5673098866 -0.4089680546 0.0449773632
[121] 0.2996909750 0.0291285957 0.2606464374 0.0396136740 -0.3177248654
[126] 0.1888993822 -0.2034297295 -0.0232089108 0.4426475048 0.5141376475
[131] 0.1530014459 -0.3316719461 0.2413163651 -0.3741550301 -0.7101174345
[136] -0.0087835198 -0.4052844408 0.0094584102 0.2799987984 0.1511699074
[141] -0.4442221876 0.1059290291 -0.1171302176 0.3063141082 0.3262576804
[146] 0.0554462885 0.1225686047 0.2775970923 0.0542280557 -0.2443914521
[151] 0.1030656958 0.6422645647 0.0776419521 -0.0718419440 0.0071866192
[156] 0.5627310427 -0.1990482717 0.1685373668 -0.0213200150 0.0009102716
[161] 0.0449295526 0.7024699706 0.1431835130 -0.0655262712 0.6043717226
[166] 0.4483780211 -0.5056968925 0.3038965444 0.4593059003 0.1396876380
[171] 0.2612085544 -0.5916346920 0.3238470985 -0.1108810361 0.5019623764
[176] -0.2891725931 -0.0027956019 0.3597480332 -0.2032697306 -0.1193458011
[181] -0.1771414280 0.1630344795 0.5881847793 0.5837265517 -0.5991355714
[186] 0.2814994985 -0.1845791920 -0.0277564805 -0.3537441131 0.7985688799
[191] -0.0063676634 -0.3107043198 0.1021487411 -0.4441604707 0.5155461426
[196] 0.1153715828 0.2803887768 -0.2828989164 0.4448229728 0.4029985884
[201] -0.0962983052 -0.1779856624 0.1580811626 0.1354079710 0.0406404094
[206] 0.0949875840 -0.4513296074 -0.2252236841 -0.3003397363 -0.5961359721
[211] 0.5940617712 0.2742541453 -0.5385152545 0.0986515218 -0.0551155322
[216] 0.1576002686 0.0686163624 0.3843086610 -0.2411071989 -0.4422243106
[221] 0.2384801875 -0.1533840585 -0.0404171837 0.6559437102 0.4940885803
[226] -0.0806907083 0.1405695851 -0.1180178046 -0.0789627814 -0.0404448208
>
> proc.time()
user system elapsed
2.162 9.766 16.411
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble"
Copyright (C) 2025 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: 0x6000022342a0>
> .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: 0x6000022342a0>
> .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: 0x6000022342a0>
> .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: 0x6000022342a0>
> 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: 0x600002200120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002200120>
> .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: 0x600002200120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002200120>
> .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: 0x600002200120>
> 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: 0x60000222c2a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60000222c2a0>
> .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: 0x60000222c2a0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60000222c2a0>
> .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: 0x60000222c2a0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x60000222c2a0>
> .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: 0x60000222c2a0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x60000222c2a0>
> .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: 0x60000222c2a0>
> 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: 0x600002200240>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002200240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002200240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002200240>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile12d5e54677bec" "BufferedMatrixFile12d5e5f91aad8"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile12d5e54677bec" "BufferedMatrixFile12d5e5f91aad8"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022004e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022004e0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000022004e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000022004e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000022004e0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000022004e0>
> .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: 0x600002220720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002220720>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002220720>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600002220720>
> 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: 0x600002220900>
> .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: 0x600002220900>
> rm(P)
>
> proc.time()
user system elapsed
0.361 0.127 0.617
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble"
Copyright (C) 2025 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.349 0.087 0.503