| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-12-18 12:06 -0500 (Thu, 18 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" | 4882 |
| 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-16 16:48:50 -0500 (Tue, 16 Dec 2025) |
| EndedAt: 2025-12-16 16:49:43 -0500 (Tue, 16 Dec 2025) |
| EllapsedTime: 53.1 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.348 0.112 0.519
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] "Tue Dec 16 16:49:15 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] "Tue Dec 16 16:49:15 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: 0x6000012c0000>
>
>
>
> 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] "Tue Dec 16 16:49:19 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] "Tue Dec 16 16:49:21 2025"
>
> ColMode(tmp2)
<pointer: 0x6000012c0000>
>
>
>
> ### 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,] 100.4553049 2.68340909 -0.89797880 1.6687820
[2,] -0.4043665 -0.09495415 -0.28697463 -0.3816067
[3,] 2.3149409 0.59468900 0.18037640 -0.3092674
[4,] 0.2491294 0.18532582 0.06370762 0.7041192
> 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 : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.4553049 2.68340909 0.89797880 1.6687820
[2,] 0.4043665 0.09495415 0.28697463 0.3816067
[3,] 2.3149409 0.59468900 0.18037640 0.3092674
[4,] 0.2491294 0.18532582 0.06370762 0.7041192
> 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 : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0227394 1.6381114 0.9476174 1.2918135
[2,] 0.6358982 0.3081463 0.5357001 0.6177433
[3,] 1.5214930 0.7711608 0.4247074 0.5561182
[4,] 0.4991287 0.4304949 0.2524037 0.8391181
>
> 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 : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 225.68270 44.06452 35.37415 39.58692
[2,] 31.76335 28.17642 30.64398 31.55904
[3,] 42.52987 33.30630 29.42745 30.87045
[4,] 30.24042 29.49027 27.58774 34.09530
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6000012c8360>
> exp(tmp5)
<pointer: 0x6000012c8360>
> log(tmp5,2)
<pointer: 0x6000012c8360>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.729
> Min(tmp5)
[1] 53.31879
> mean(tmp5)
[1] 72.96082
> Sum(tmp5)
[1] 14592.16
> Var(tmp5)
[1] 887.1138
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 93.47939 69.19903 71.96214 68.23986 70.73478 67.64284 72.22183 68.76764
[9] 75.67162 71.68909
> rowSums(tmp5)
[1] 1869.588 1383.981 1439.243 1364.797 1414.696 1352.857 1444.437 1375.353
[9] 1513.432 1433.782
> rowVars(tmp5)
[1] 7928.40360 108.77945 86.07472 93.63690 108.54513 69.41416
[7] 73.00477 88.55261 79.46142 109.39496
> rowSd(tmp5)
[1] 89.041584 10.429739 9.277646 9.676616 10.418499 8.331516 8.544283
[8] 9.410240 8.914114 10.459205
> rowMax(tmp5)
[1] 469.72897 86.41241 88.52035 84.93140 89.62065 80.06052 86.55540
[8] 83.07543 90.30276 89.55191
> rowMin(tmp5)
[1] 56.59504 54.04562 54.24835 54.11952 53.31879 55.51949 57.18820 56.13930
[9] 57.56146 56.55047
>
> colMeans(tmp5)
[1] 113.91871 70.61487 65.49720 66.94599 69.47684 68.61079 72.84877
[8] 71.77123 70.89814 69.13731 69.99510 69.96565 69.38947 73.18902
[15] 72.65463 73.85994 70.57022 75.55049 70.27937 74.04269
> colSums(tmp5)
[1] 1139.1871 706.1487 654.9720 669.4599 694.7684 686.1079 728.4877
[8] 717.7123 708.9814 691.3731 699.9510 699.6565 693.8947 731.8902
[15] 726.5463 738.5994 705.7022 755.5049 702.7937 740.4269
> colVars(tmp5)
[1] 15731.81179 129.39558 67.12126 55.05735 52.82740 138.66589
[7] 101.46493 127.46809 93.94724 124.91539 103.13846 183.72085
[13] 120.08978 90.45509 80.35189 40.21530 81.12813 75.55818
[19] 57.72635 72.72939
> colSd(tmp5)
[1] 125.426519 11.375218 8.192757 7.420064 7.268246 11.775648
[7] 10.072980 11.290177 9.692638 11.176555 10.155711 13.554367
[13] 10.958548 9.510788 8.963922 6.341554 9.007115 8.692421
[19] 7.597786 8.528153
> colMax(tmp5)
[1] 469.72897 91.71453 77.26246 82.39498 81.39612 90.30276 86.41241
[8] 89.90705 83.25952 85.32725 85.90063 87.31821 89.55191 85.07943
[15] 85.67278 84.40896 84.48815 86.88753 79.36197 89.62065
> colMin(tmp5)
[1] 59.52691 56.46073 53.31879 56.38447 58.62778 56.55047 56.59504 54.04562
[9] 57.15589 55.51949 56.74430 54.11952 54.24835 58.03380 56.13930 66.72429
[17] 56.24990 56.64281 57.18820 63.06363
>
>
> ### 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] 93.47939 69.19903 71.96214 68.23986 70.73478 67.64284 NA 68.76764
[9] 75.67162 71.68909
> rowSums(tmp5)
[1] 1869.588 1383.981 1439.243 1364.797 1414.696 1352.857 NA 1375.353
[9] 1513.432 1433.782
> rowVars(tmp5)
[1] 7928.40360 108.77945 86.07472 93.63690 108.54513 69.41416
[7] 65.04591 88.55261 79.46142 109.39496
> rowSd(tmp5)
[1] 89.041584 10.429739 9.277646 9.676616 10.418499 8.331516 8.065105
[8] 9.410240 8.914114 10.459205
> rowMax(tmp5)
[1] 469.72897 86.41241 88.52035 84.93140 89.62065 80.06052 NA
[8] 83.07543 90.30276 89.55191
> rowMin(tmp5)
[1] 56.59504 54.04562 54.24835 54.11952 53.31879 55.51949 NA 56.13930
[9] 57.56146 56.55047
>
> colMeans(tmp5)
[1] 113.91871 70.61487 65.49720 66.94599 69.47684 68.61079 72.84877
[8] 71.77123 70.89814 69.13731 69.99510 NA 69.38947 73.18902
[15] 72.65463 73.85994 70.57022 75.55049 70.27937 74.04269
> colSums(tmp5)
[1] 1139.1871 706.1487 654.9720 669.4599 694.7684 686.1079 728.4877
[8] 717.7123 708.9814 691.3731 699.9510 NA 693.8947 731.8902
[15] 726.5463 738.5994 705.7022 755.5049 702.7937 740.4269
> colVars(tmp5)
[1] 15731.81179 129.39558 67.12126 55.05735 52.82740 138.66589
[7] 101.46493 127.46809 93.94724 124.91539 103.13846 NA
[13] 120.08978 90.45509 80.35189 40.21530 81.12813 75.55818
[19] 57.72635 72.72939
> colSd(tmp5)
[1] 125.426519 11.375218 8.192757 7.420064 7.268246 11.775648
[7] 10.072980 11.290177 9.692638 11.176555 10.155711 NA
[13] 10.958548 9.510788 8.963922 6.341554 9.007115 8.692421
[19] 7.597786 8.528153
> colMax(tmp5)
[1] 469.72897 91.71453 77.26246 82.39498 81.39612 90.30276 86.41241
[8] 89.90705 83.25952 85.32725 85.90063 NA 89.55191 85.07943
[15] 85.67278 84.40896 84.48815 86.88753 79.36197 89.62065
> colMin(tmp5)
[1] 59.52691 56.46073 53.31879 56.38447 58.62778 56.55047 56.59504 54.04562
[9] 57.15589 55.51949 56.74430 NA 54.24835 58.03380 56.13930 66.72429
[17] 56.24990 56.64281 57.18820 63.06363
>
> Max(tmp5,na.rm=TRUE)
[1] 469.729
> Min(tmp5,na.rm=TRUE)
[1] 53.31879
> mean(tmp5,na.rm=TRUE)
[1] 72.89251
> Sum(tmp5,na.rm=TRUE)
[1] 14505.61
> Var(tmp5,na.rm=TRUE)
[1] 890.6561
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 93.47939 69.19903 71.96214 68.23986 70.73478 67.64284 71.46744 68.76764
[9] 75.67162 71.68909
> rowSums(tmp5,na.rm=TRUE)
[1] 1869.588 1383.981 1439.243 1364.797 1414.696 1352.857 1357.881 1375.353
[9] 1513.432 1433.782
> rowVars(tmp5,na.rm=TRUE)
[1] 7928.40360 108.77945 86.07472 93.63690 108.54513 69.41416
[7] 65.04591 88.55261 79.46142 109.39496
> rowSd(tmp5,na.rm=TRUE)
[1] 89.041584 10.429739 9.277646 9.676616 10.418499 8.331516 8.065105
[8] 9.410240 8.914114 10.459205
> rowMax(tmp5,na.rm=TRUE)
[1] 469.72897 86.41241 88.52035 84.93140 89.62065 80.06052 84.78235
[8] 83.07543 90.30276 89.55191
> rowMin(tmp5,na.rm=TRUE)
[1] 56.59504 54.04562 54.24835 54.11952 53.31879 55.51949 57.18820 56.13930
[9] 57.56146 56.55047
>
> colMeans(tmp5,na.rm=TRUE)
[1] 113.91871 70.61487 65.49720 66.94599 69.47684 68.61079 72.84877
[8] 71.77123 70.89814 69.13731 69.99510 68.12234 69.38947 73.18902
[15] 72.65463 73.85994 70.57022 75.55049 70.27937 74.04269
> colSums(tmp5,na.rm=TRUE)
[1] 1139.1871 706.1487 654.9720 669.4599 694.7684 686.1079 728.4877
[8] 717.7123 708.9814 691.3731 699.9510 613.1011 693.8947 731.8902
[15] 726.5463 738.5994 705.7022 755.5049 702.7937 740.4269
> colVars(tmp5,na.rm=TRUE)
[1] 15731.81179 129.39558 67.12126 55.05735 52.82740 138.66589
[7] 101.46493 127.46809 93.94724 124.91539 103.13846 168.46100
[13] 120.08978 90.45509 80.35189 40.21530 81.12813 75.55818
[19] 57.72635 72.72939
> colSd(tmp5,na.rm=TRUE)
[1] 125.426519 11.375218 8.192757 7.420064 7.268246 11.775648
[7] 10.072980 11.290177 9.692638 11.176555 10.155711 12.979253
[13] 10.958548 9.510788 8.963922 6.341554 9.007115 8.692421
[19] 7.597786 8.528153
> colMax(tmp5,na.rm=TRUE)
[1] 469.72897 91.71453 77.26246 82.39498 81.39612 90.30276 86.41241
[8] 89.90705 83.25952 85.32725 85.90063 87.31821 89.55191 85.07943
[15] 85.67278 84.40896 84.48815 86.88753 79.36197 89.62065
> colMin(tmp5,na.rm=TRUE)
[1] 59.52691 56.46073 53.31879 56.38447 58.62778 56.55047 56.59504 54.04562
[9] 57.15589 55.51949 56.74430 54.11952 54.24835 58.03380 56.13930 66.72429
[17] 56.24990 56.64281 57.18820 63.06363
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 93.47939 69.19903 71.96214 68.23986 70.73478 67.64284 NaN 68.76764
[9] 75.67162 71.68909
> rowSums(tmp5,na.rm=TRUE)
[1] 1869.588 1383.981 1439.243 1364.797 1414.696 1352.857 0.000 1375.353
[9] 1513.432 1433.782
> rowVars(tmp5,na.rm=TRUE)
[1] 7928.40360 108.77945 86.07472 93.63690 108.54513 69.41416
[7] NA 88.55261 79.46142 109.39496
> rowSd(tmp5,na.rm=TRUE)
[1] 89.041584 10.429739 9.277646 9.676616 10.418499 8.331516 NA
[8] 9.410240 8.914114 10.459205
> rowMax(tmp5,na.rm=TRUE)
[1] 469.72897 86.41241 88.52035 84.93140 89.62065 80.06052 NA
[8] 83.07543 90.30276 89.55191
> rowMin(tmp5,na.rm=TRUE)
[1] 56.59504 54.04562 54.24835 54.11952 53.31879 55.51949 NA 56.13930
[9] 57.56146 56.55047
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 118.03572 71.21361 66.10125 66.75186 68.76381 66.85520 73.55993
[8] 71.36357 71.16624 70.39933 69.08681 NaN 68.78616 72.52438
[15] 72.68382 74.58937 70.75358 75.51830 71.73394 72.84939
> colSums(tmp5,na.rm=TRUE)
[1] 1062.3215 640.9225 594.9113 600.7667 618.8743 601.6968 662.0394
[8] 642.2722 640.4962 633.5940 621.7813 0.0000 619.0754 652.7194
[15] 654.1544 671.3043 636.7822 679.6647 645.6055 655.6445
> colVars(tmp5,na.rm=TRUE)
[1] 17507.60304 141.53712 71.40651 61.51555 53.71116 121.32557
[7] 108.45841 141.53203 104.88199 122.61194 106.74977 NA
[13] 131.00621 96.79228 90.38630 39.25653 90.89092 84.99130
[19] 41.13954 65.80109
> colSd(tmp5,na.rm=TRUE)
[1] 132.316299 11.896938 8.450237 7.843185 7.328790 11.014789
[7] 10.414337 11.896724 10.241191 11.073027 10.331978 NA
[13] 11.445794 9.838307 9.507171 6.265503 9.533673 9.219073
[19] 6.414012 8.111787
> colMax(tmp5,na.rm=TRUE)
[1] 469.72897 91.71453 77.26246 82.39498 81.39612 90.30276 86.41241
[8] 89.90705 83.25952 85.32725 85.90063 -Inf 89.55191 85.07943
[15] 85.67278 84.40896 84.48815 86.88753 79.36197 89.62065
> colMin(tmp5,na.rm=TRUE)
[1] 59.52691 56.46073 53.31879 56.38447 58.62778 56.55047 56.59504 54.04562
[9] 57.15589 55.51949 56.74430 Inf 54.24835 58.03380 56.13930 66.72429
[17] 56.24990 56.64281 60.18094 63.06363
>
>
>
>
> 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] 212.9284 360.7495 328.9779 344.7669 185.8326 350.6986 187.5782 251.2350
[9] 176.6558 166.5031
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 212.9284 360.7495 328.9779 344.7669 185.8326 350.6986 187.5782 251.2350
[9] 176.6558 166.5031
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] -2.842171e-14 -2.842171e-14 -2.273737e-13 -2.842171e-14 -1.421085e-13
[6] 2.273737e-13 -5.684342e-14 -4.263256e-14 0.000000e+00 2.273737e-13
[11] 8.526513e-14 -1.136868e-13 -5.684342e-14 0.000000e+00 2.842171e-14
[16] 0.000000e+00 5.684342e-14 1.136868e-13 -1.421085e-14 5.684342e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
9 9
3 17
5 11
3 2
10 8
1 8
1 13
1 20
6 3
4 20
10 6
4 19
3 10
7 7
4 14
3 20
4 11
2 5
9 8
6 9
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.072996
> Min(tmp)
[1] -2.621813
> mean(tmp)
[1] -0.1774776
> Sum(tmp)
[1] -17.74776
> Var(tmp)
[1] 0.9096879
>
> rowMeans(tmp)
[1] -0.1774776
> rowSums(tmp)
[1] -17.74776
> rowVars(tmp)
[1] 0.9096879
> rowSd(tmp)
[1] 0.9537756
> rowMax(tmp)
[1] 2.072996
> rowMin(tmp)
[1] -2.621813
>
> colMeans(tmp)
[1] -0.252738219 -0.285009814 -1.934700010 -0.221195014 -0.257721466
[6] 0.534179853 1.249666650 -0.950023665 1.947953072 1.250789760
[11] 0.136030223 0.543331259 0.964248504 1.292524697 1.070626990
[16] -0.825575671 -0.603466916 -0.975519266 0.298150720 -0.440060060
[21] 0.516434958 0.548262333 -1.242528953 0.420685480 0.379876168
[26] 0.535124289 0.008245169 -0.660665955 0.878436432 -0.460618184
[31] 0.116065263 0.224762589 -0.141976659 0.929390797 0.619072412
[36] -0.327087462 0.596031611 0.897064085 -0.108349118 -0.616947674
[41] -0.958528581 0.446294168 -0.545104108 -1.253201781 -0.398467041
[46] -1.460191773 1.336016237 -0.034082954 -0.084381980 0.110242475
[51] 0.574127325 -0.020445926 0.993333694 1.399035812 0.159761888
[56] 1.376315940 2.072995637 -0.216538326 0.478720420 1.059906327
[61] 0.520826213 -0.598109130 0.628546553 -0.683979679 0.158149713
[66] -0.619409796 0.453717632 -0.567560994 -0.437208011 -0.029623851
[71] -0.350773730 0.499049486 -0.605869914 -2.621813440 -0.580852828
[76] -0.944972732 -1.017504430 -0.624856249 -1.546983814 -2.362525995
[81] 0.293892813 -0.993927486 -1.237261942 -1.144956614 -1.662794488
[86] -2.298287188 -0.617534450 -1.364890045 -0.662239796 -0.503522015
[91] -1.140859980 -1.383098994 -1.013367863 -0.037295471 -2.061371924
[96] 1.452598826 -0.408048280 -1.713611879 -0.321218339 -0.286784727
> colSums(tmp)
[1] -0.252738219 -0.285009814 -1.934700010 -0.221195014 -0.257721466
[6] 0.534179853 1.249666650 -0.950023665 1.947953072 1.250789760
[11] 0.136030223 0.543331259 0.964248504 1.292524697 1.070626990
[16] -0.825575671 -0.603466916 -0.975519266 0.298150720 -0.440060060
[21] 0.516434958 0.548262333 -1.242528953 0.420685480 0.379876168
[26] 0.535124289 0.008245169 -0.660665955 0.878436432 -0.460618184
[31] 0.116065263 0.224762589 -0.141976659 0.929390797 0.619072412
[36] -0.327087462 0.596031611 0.897064085 -0.108349118 -0.616947674
[41] -0.958528581 0.446294168 -0.545104108 -1.253201781 -0.398467041
[46] -1.460191773 1.336016237 -0.034082954 -0.084381980 0.110242475
[51] 0.574127325 -0.020445926 0.993333694 1.399035812 0.159761888
[56] 1.376315940 2.072995637 -0.216538326 0.478720420 1.059906327
[61] 0.520826213 -0.598109130 0.628546553 -0.683979679 0.158149713
[66] -0.619409796 0.453717632 -0.567560994 -0.437208011 -0.029623851
[71] -0.350773730 0.499049486 -0.605869914 -2.621813440 -0.580852828
[76] -0.944972732 -1.017504430 -0.624856249 -1.546983814 -2.362525995
[81] 0.293892813 -0.993927486 -1.237261942 -1.144956614 -1.662794488
[86] -2.298287188 -0.617534450 -1.364890045 -0.662239796 -0.503522015
[91] -1.140859980 -1.383098994 -1.013367863 -0.037295471 -2.061371924
[96] 1.452598826 -0.408048280 -1.713611879 -0.321218339 -0.286784727
> 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.252738219 -0.285009814 -1.934700010 -0.221195014 -0.257721466
[6] 0.534179853 1.249666650 -0.950023665 1.947953072 1.250789760
[11] 0.136030223 0.543331259 0.964248504 1.292524697 1.070626990
[16] -0.825575671 -0.603466916 -0.975519266 0.298150720 -0.440060060
[21] 0.516434958 0.548262333 -1.242528953 0.420685480 0.379876168
[26] 0.535124289 0.008245169 -0.660665955 0.878436432 -0.460618184
[31] 0.116065263 0.224762589 -0.141976659 0.929390797 0.619072412
[36] -0.327087462 0.596031611 0.897064085 -0.108349118 -0.616947674
[41] -0.958528581 0.446294168 -0.545104108 -1.253201781 -0.398467041
[46] -1.460191773 1.336016237 -0.034082954 -0.084381980 0.110242475
[51] 0.574127325 -0.020445926 0.993333694 1.399035812 0.159761888
[56] 1.376315940 2.072995637 -0.216538326 0.478720420 1.059906327
[61] 0.520826213 -0.598109130 0.628546553 -0.683979679 0.158149713
[66] -0.619409796 0.453717632 -0.567560994 -0.437208011 -0.029623851
[71] -0.350773730 0.499049486 -0.605869914 -2.621813440 -0.580852828
[76] -0.944972732 -1.017504430 -0.624856249 -1.546983814 -2.362525995
[81] 0.293892813 -0.993927486 -1.237261942 -1.144956614 -1.662794488
[86] -2.298287188 -0.617534450 -1.364890045 -0.662239796 -0.503522015
[91] -1.140859980 -1.383098994 -1.013367863 -0.037295471 -2.061371924
[96] 1.452598826 -0.408048280 -1.713611879 -0.321218339 -0.286784727
> colMin(tmp)
[1] -0.252738219 -0.285009814 -1.934700010 -0.221195014 -0.257721466
[6] 0.534179853 1.249666650 -0.950023665 1.947953072 1.250789760
[11] 0.136030223 0.543331259 0.964248504 1.292524697 1.070626990
[16] -0.825575671 -0.603466916 -0.975519266 0.298150720 -0.440060060
[21] 0.516434958 0.548262333 -1.242528953 0.420685480 0.379876168
[26] 0.535124289 0.008245169 -0.660665955 0.878436432 -0.460618184
[31] 0.116065263 0.224762589 -0.141976659 0.929390797 0.619072412
[36] -0.327087462 0.596031611 0.897064085 -0.108349118 -0.616947674
[41] -0.958528581 0.446294168 -0.545104108 -1.253201781 -0.398467041
[46] -1.460191773 1.336016237 -0.034082954 -0.084381980 0.110242475
[51] 0.574127325 -0.020445926 0.993333694 1.399035812 0.159761888
[56] 1.376315940 2.072995637 -0.216538326 0.478720420 1.059906327
[61] 0.520826213 -0.598109130 0.628546553 -0.683979679 0.158149713
[66] -0.619409796 0.453717632 -0.567560994 -0.437208011 -0.029623851
[71] -0.350773730 0.499049486 -0.605869914 -2.621813440 -0.580852828
[76] -0.944972732 -1.017504430 -0.624856249 -1.546983814 -2.362525995
[81] 0.293892813 -0.993927486 -1.237261942 -1.144956614 -1.662794488
[86] -2.298287188 -0.617534450 -1.364890045 -0.662239796 -0.503522015
[91] -1.140859980 -1.383098994 -1.013367863 -0.037295471 -2.061371924
[96] 1.452598826 -0.408048280 -1.713611879 -0.321218339 -0.286784727
> colMedians(tmp)
[1] -0.252738219 -0.285009814 -1.934700010 -0.221195014 -0.257721466
[6] 0.534179853 1.249666650 -0.950023665 1.947953072 1.250789760
[11] 0.136030223 0.543331259 0.964248504 1.292524697 1.070626990
[16] -0.825575671 -0.603466916 -0.975519266 0.298150720 -0.440060060
[21] 0.516434958 0.548262333 -1.242528953 0.420685480 0.379876168
[26] 0.535124289 0.008245169 -0.660665955 0.878436432 -0.460618184
[31] 0.116065263 0.224762589 -0.141976659 0.929390797 0.619072412
[36] -0.327087462 0.596031611 0.897064085 -0.108349118 -0.616947674
[41] -0.958528581 0.446294168 -0.545104108 -1.253201781 -0.398467041
[46] -1.460191773 1.336016237 -0.034082954 -0.084381980 0.110242475
[51] 0.574127325 -0.020445926 0.993333694 1.399035812 0.159761888
[56] 1.376315940 2.072995637 -0.216538326 0.478720420 1.059906327
[61] 0.520826213 -0.598109130 0.628546553 -0.683979679 0.158149713
[66] -0.619409796 0.453717632 -0.567560994 -0.437208011 -0.029623851
[71] -0.350773730 0.499049486 -0.605869914 -2.621813440 -0.580852828
[76] -0.944972732 -1.017504430 -0.624856249 -1.546983814 -2.362525995
[81] 0.293892813 -0.993927486 -1.237261942 -1.144956614 -1.662794488
[86] -2.298287188 -0.617534450 -1.364890045 -0.662239796 -0.503522015
[91] -1.140859980 -1.383098994 -1.013367863 -0.037295471 -2.061371924
[96] 1.452598826 -0.408048280 -1.713611879 -0.321218339 -0.286784727
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.2527382 -0.2850098 -1.9347 -0.221195 -0.2577215 0.5341799 1.249667
[2,] -0.2527382 -0.2850098 -1.9347 -0.221195 -0.2577215 0.5341799 1.249667
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.9500237 1.947953 1.25079 0.1360302 0.5433313 0.9642485 1.292525
[2,] -0.9500237 1.947953 1.25079 0.1360302 0.5433313 0.9642485 1.292525
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 1.070627 -0.8255757 -0.6034669 -0.9755193 0.2981507 -0.4400601 0.516435
[2,] 1.070627 -0.8255757 -0.6034669 -0.9755193 0.2981507 -0.4400601 0.516435
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.5482623 -1.242529 0.4206855 0.3798762 0.5351243 0.008245169 -0.660666
[2,] 0.5482623 -1.242529 0.4206855 0.3798762 0.5351243 0.008245169 -0.660666
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.8784364 -0.4606182 0.1160653 0.2247626 -0.1419767 0.9293908 0.6190724
[2,] 0.8784364 -0.4606182 0.1160653 0.2247626 -0.1419767 0.9293908 0.6190724
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.3270875 0.5960316 0.8970641 -0.1083491 -0.6169477 -0.9585286 0.4462942
[2,] -0.3270875 0.5960316 0.8970641 -0.1083491 -0.6169477 -0.9585286 0.4462942
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.5451041 -1.253202 -0.398467 -1.460192 1.336016 -0.03408295 -0.08438198
[2,] -0.5451041 -1.253202 -0.398467 -1.460192 1.336016 -0.03408295 -0.08438198
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.1102425 0.5741273 -0.02044593 0.9933337 1.399036 0.1597619 1.376316
[2,] 0.1102425 0.5741273 -0.02044593 0.9933337 1.399036 0.1597619 1.376316
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 2.072996 -0.2165383 0.4787204 1.059906 0.5208262 -0.5981091 0.6285466
[2,] 2.072996 -0.2165383 0.4787204 1.059906 0.5208262 -0.5981091 0.6285466
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.6839797 0.1581497 -0.6194098 0.4537176 -0.567561 -0.437208 -0.02962385
[2,] -0.6839797 0.1581497 -0.6194098 0.4537176 -0.567561 -0.437208 -0.02962385
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.3507737 0.4990495 -0.6058699 -2.621813 -0.5808528 -0.9449727 -1.017504
[2,] -0.3507737 0.4990495 -0.6058699 -2.621813 -0.5808528 -0.9449727 -1.017504
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.6248562 -1.546984 -2.362526 0.2938928 -0.9939275 -1.237262 -1.144957
[2,] -0.6248562 -1.546984 -2.362526 0.2938928 -0.9939275 -1.237262 -1.144957
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -1.662794 -2.298287 -0.6175344 -1.36489 -0.6622398 -0.503522 -1.14086
[2,] -1.662794 -2.298287 -0.6175344 -1.36489 -0.6622398 -0.503522 -1.14086
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -1.383099 -1.013368 -0.03729547 -2.061372 1.452599 -0.4080483 -1.713612
[2,] -1.383099 -1.013368 -0.03729547 -2.061372 1.452599 -0.4080483 -1.713612
[,99] [,100]
[1,] -0.3212183 -0.2867847
[2,] -0.3212183 -0.2867847
>
>
> Max(tmp2)
[1] 3.527675
> Min(tmp2)
[1] -2.641407
> mean(tmp2)
[1] 0.08681067
> Sum(tmp2)
[1] 8.681067
> Var(tmp2)
[1] 1.111882
>
> rowMeans(tmp2)
[1] -0.14302470 0.66484865 0.02828774 1.10397913 0.23090822 -1.54655594
[7] -0.59974591 0.91871255 -0.30530536 -0.60076870 0.05843911 3.52767487
[13] 0.47899273 -0.11797985 -1.04269397 -1.29959823 -0.19524895 1.48952303
[19] 0.28816206 1.21960196 -1.48641794 1.03868898 -0.29750570 -0.58040111
[25] 1.91201039 -1.52254186 1.05649692 0.19572741 -0.31146522 -1.42519620
[31] -0.01738849 -0.99834245 -0.34797482 2.23799200 -2.01313932 -2.64140712
[37] -0.26431968 -0.53927286 1.53440241 -1.24099865 0.76200190 -0.33918189
[43] -0.21839724 0.56372413 0.89973174 1.68000534 1.95805147 0.30490342
[49] -1.05156246 -0.16577612 -0.38577053 0.07397254 -0.56209265 0.29659575
[55] 0.15582225 -1.74943784 0.07311201 1.13374702 -0.47060244 0.14986365
[61] -1.23409212 -1.26755281 0.45506267 2.30251900 0.59306680 -1.09074600
[67] 1.24531920 0.42967804 0.34519756 0.74276118 -0.04559604 0.66300678
[73] -0.98535407 0.88893455 1.01067538 0.15585798 -0.75878745 1.79149578
[79] 1.31994013 0.38082758 -1.19526805 -0.03987679 0.65610956 0.82831502
[85] 1.47667376 0.07420737 -1.52361346 -1.18841137 0.63848408 -0.69835275
[91] -0.61686238 1.49719382 -1.04800078 0.19490685 0.27987969 -0.11298361
[97] -0.80031851 0.56855318 0.44777535 0.74457713
> rowSums(tmp2)
[1] -0.14302470 0.66484865 0.02828774 1.10397913 0.23090822 -1.54655594
[7] -0.59974591 0.91871255 -0.30530536 -0.60076870 0.05843911 3.52767487
[13] 0.47899273 -0.11797985 -1.04269397 -1.29959823 -0.19524895 1.48952303
[19] 0.28816206 1.21960196 -1.48641794 1.03868898 -0.29750570 -0.58040111
[25] 1.91201039 -1.52254186 1.05649692 0.19572741 -0.31146522 -1.42519620
[31] -0.01738849 -0.99834245 -0.34797482 2.23799200 -2.01313932 -2.64140712
[37] -0.26431968 -0.53927286 1.53440241 -1.24099865 0.76200190 -0.33918189
[43] -0.21839724 0.56372413 0.89973174 1.68000534 1.95805147 0.30490342
[49] -1.05156246 -0.16577612 -0.38577053 0.07397254 -0.56209265 0.29659575
[55] 0.15582225 -1.74943784 0.07311201 1.13374702 -0.47060244 0.14986365
[61] -1.23409212 -1.26755281 0.45506267 2.30251900 0.59306680 -1.09074600
[67] 1.24531920 0.42967804 0.34519756 0.74276118 -0.04559604 0.66300678
[73] -0.98535407 0.88893455 1.01067538 0.15585798 -0.75878745 1.79149578
[79] 1.31994013 0.38082758 -1.19526805 -0.03987679 0.65610956 0.82831502
[85] 1.47667376 0.07420737 -1.52361346 -1.18841137 0.63848408 -0.69835275
[91] -0.61686238 1.49719382 -1.04800078 0.19490685 0.27987969 -0.11298361
[97] -0.80031851 0.56855318 0.44777535 0.74457713
> rowVars(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
[1] -0.14302470 0.66484865 0.02828774 1.10397913 0.23090822 -1.54655594
[7] -0.59974591 0.91871255 -0.30530536 -0.60076870 0.05843911 3.52767487
[13] 0.47899273 -0.11797985 -1.04269397 -1.29959823 -0.19524895 1.48952303
[19] 0.28816206 1.21960196 -1.48641794 1.03868898 -0.29750570 -0.58040111
[25] 1.91201039 -1.52254186 1.05649692 0.19572741 -0.31146522 -1.42519620
[31] -0.01738849 -0.99834245 -0.34797482 2.23799200 -2.01313932 -2.64140712
[37] -0.26431968 -0.53927286 1.53440241 -1.24099865 0.76200190 -0.33918189
[43] -0.21839724 0.56372413 0.89973174 1.68000534 1.95805147 0.30490342
[49] -1.05156246 -0.16577612 -0.38577053 0.07397254 -0.56209265 0.29659575
[55] 0.15582225 -1.74943784 0.07311201 1.13374702 -0.47060244 0.14986365
[61] -1.23409212 -1.26755281 0.45506267 2.30251900 0.59306680 -1.09074600
[67] 1.24531920 0.42967804 0.34519756 0.74276118 -0.04559604 0.66300678
[73] -0.98535407 0.88893455 1.01067538 0.15585798 -0.75878745 1.79149578
[79] 1.31994013 0.38082758 -1.19526805 -0.03987679 0.65610956 0.82831502
[85] 1.47667376 0.07420737 -1.52361346 -1.18841137 0.63848408 -0.69835275
[91] -0.61686238 1.49719382 -1.04800078 0.19490685 0.27987969 -0.11298361
[97] -0.80031851 0.56855318 0.44777535 0.74457713
> rowMin(tmp2)
[1] -0.14302470 0.66484865 0.02828774 1.10397913 0.23090822 -1.54655594
[7] -0.59974591 0.91871255 -0.30530536 -0.60076870 0.05843911 3.52767487
[13] 0.47899273 -0.11797985 -1.04269397 -1.29959823 -0.19524895 1.48952303
[19] 0.28816206 1.21960196 -1.48641794 1.03868898 -0.29750570 -0.58040111
[25] 1.91201039 -1.52254186 1.05649692 0.19572741 -0.31146522 -1.42519620
[31] -0.01738849 -0.99834245 -0.34797482 2.23799200 -2.01313932 -2.64140712
[37] -0.26431968 -0.53927286 1.53440241 -1.24099865 0.76200190 -0.33918189
[43] -0.21839724 0.56372413 0.89973174 1.68000534 1.95805147 0.30490342
[49] -1.05156246 -0.16577612 -0.38577053 0.07397254 -0.56209265 0.29659575
[55] 0.15582225 -1.74943784 0.07311201 1.13374702 -0.47060244 0.14986365
[61] -1.23409212 -1.26755281 0.45506267 2.30251900 0.59306680 -1.09074600
[67] 1.24531920 0.42967804 0.34519756 0.74276118 -0.04559604 0.66300678
[73] -0.98535407 0.88893455 1.01067538 0.15585798 -0.75878745 1.79149578
[79] 1.31994013 0.38082758 -1.19526805 -0.03987679 0.65610956 0.82831502
[85] 1.47667376 0.07420737 -1.52361346 -1.18841137 0.63848408 -0.69835275
[91] -0.61686238 1.49719382 -1.04800078 0.19490685 0.27987969 -0.11298361
[97] -0.80031851 0.56855318 0.44777535 0.74457713
>
> colMeans(tmp2)
[1] 0.08681067
> colSums(tmp2)
[1] 8.681067
> colVars(tmp2)
[1] 1.111882
> colSd(tmp2)
[1] 1.054458
> colMax(tmp2)
[1] 3.527675
> colMin(tmp2)
[1] -2.641407
> colMedians(tmp2)
[1] 0.07408996
> colRanges(tmp2)
[,1]
[1,] -2.641407
[2,] 3.527675
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.5653848 -3.3584370 0.8893523 -3.9113929 -4.7350473 -0.5574225
[7] -0.8936895 -0.9659975 -5.2069693 -0.8630764
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.0255883
[2,] -0.7238395
[3,] -0.1959762
[4,] 0.6495725
[5,] 2.1662659
>
> rowApply(tmp,sum)
[1] -7.2399232 -2.7038451 2.8557706 0.9920883 -8.6104062 1.9114273
[7] 0.2368417 -3.0694361 -7.2015573 3.7917448
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 6 2 5 10 10 1 6 4 8 8
[2,] 5 6 10 1 5 2 7 9 3 1
[3,] 2 9 6 7 3 4 10 5 9 3
[4,] 7 3 1 6 7 7 1 7 5 9
[5,] 1 7 7 4 6 9 4 2 4 7
[6,] 9 5 3 8 4 3 9 10 2 2
[7,] 4 8 2 2 8 6 5 8 7 10
[8,] 10 4 4 5 9 10 8 1 1 4
[9,] 3 10 8 3 1 5 2 3 10 5
[10,] 8 1 9 9 2 8 3 6 6 6
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.6170604 0.4656505 2.0868380 2.7572802 -0.4272622 1.3443937
[7] 2.9719691 -2.1591324 0.0074052 -2.2952096 1.7756305 2.0247413
[13] 0.7130703 -1.3955130 3.8107540 -1.4069347 -2.7174636 -3.2173423
[19] -0.8173046 0.6602896
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.0947194
[2,] -1.3859998
[3,] 0.2190863
[4,] 0.2868604
[5,] 1.3577121
>
> rowApply(tmp,sum)
[1] 5.4387871 0.4260842 -1.2290251 -6.8243791 4.7533324
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 17 3 13 1 10
[2,] 16 13 11 4 15
[3,] 14 18 19 2 17
[4,] 15 5 7 20 20
[5,] 11 6 6 12 12
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1.3577121 0.9608857 0.7859793 0.8035766 0.44301483 -0.5656762
[2,] -1.3859998 0.3649311 0.7034778 -0.6483101 -0.53497507 1.7495875
[3,] 0.2190863 -0.1299356 1.5064727 -0.5333900 -0.71781103 0.3043885
[4,] -2.0947194 -1.3394739 -1.9937389 1.1046361 0.05884827 0.2049194
[5,] 0.2868604 0.6092431 1.0846472 2.0307676 0.32366080 -0.3488255
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 2.01367310 -1.65809686 0.6396250 -1.2474651 0.39415114 0.4058111
[2,] 0.40129452 0.24758326 0.5532646 -1.7568963 0.03635134 0.5817104
[3,] 1.99797382 -0.42357587 -0.4015370 0.7980276 0.48238750 0.9250111
[4,] -1.40942972 0.07472504 -1.3051895 -0.2087825 0.19618395 -0.2035124
[5,] -0.03154259 -0.39976795 0.5212421 0.1199065 0.66655653 0.3157212
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.14402171 -0.8575128 1.8826018 2.3920739 -0.2953960 -1.7605479
[2,] 0.05882281 -0.0571710 2.5513849 -2.3761864 -0.9263695 0.3024708
[3,] 0.35677804 -0.1240069 -0.8339433 -0.8191694 -1.9035993 -0.8087748
[4,] 0.24665120 0.3213627 0.7181414 0.6545398 -0.8578963 -0.1048841
[5,] -0.09320347 -0.6781850 -0.5074308 -1.2581926 1.2657976 -0.8456064
[,19] [,20]
[1,] -0.9135556 0.51391124
[2,] 0.4782441 0.08286934
[3,] -0.2051362 -0.91827124
[4,] -0.7143668 -0.17239353
[5,] 0.5375099 1.15417380
>
>
> 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 : 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.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 563 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.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.07662462 1.701375 -0.7448494 -1.57356 0.04175846 -1.290086 -0.5116285
col8 col9 col10 col11 col12 col13 col14
row1 -0.1511907 0.4401222 1.372414 -1.685645 1.539854 -1.231414 0.1485333
col15 col16 col17 col18 col19 col20
row1 -0.8401812 0.8349892 0.8716715 -0.6651427 1.281388 0.7666004
> tmp[,"col10"]
col10
row1 1.3724142
row2 0.4589827
row3 -0.1926404
row4 0.1628548
row5 0.1681447
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 0.07662462 1.701375 -0.7448494 -1.5735602 0.04175846 -1.2900864
row5 -0.37104882 -1.545842 -0.8498310 -0.6216919 0.04416782 0.1597587
col7 col8 col9 col10 col11 col12 col13
row1 -0.5116285 -0.1511907 0.4401222 1.3724142 -1.6856454 1.5398539 -1.231414
row5 -0.9171407 0.8776761 1.1599535 0.1681447 0.5040622 -0.4230115 2.799104
col14 col15 col16 col17 col18 col19
row1 0.1485333 -0.8401812 0.8349892 0.8716715 -0.665142717 1.28138758
row5 0.3919013 0.2350624 -1.0241251 -0.4061339 0.007527668 -0.06467134
col20
row1 0.7666004
row5 -0.4376104
> tmp[,c("col6","col20")]
col6 col20
row1 -1.2900864 0.7666004
row2 1.0898389 0.3064717
row3 0.4660696 -0.1446370
row4 -0.4612046 0.3482050
row5 0.1597587 -0.4376104
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -1.2900864 0.7666004
row5 0.1597587 -0.4376104
>
>
>
>
> 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.80269 51.3913 49.20936 46.74675 48.86626 104.8345 49.51101 47.51938
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.40414 49.28474 50.68554 51.02596 48.98488 47.67211 50.23279 49.90713
col17 col18 col19 col20
row1 50.82384 49.01567 50.03134 105.3092
> tmp[,"col10"]
col10
row1 49.28474
row2 29.48403
row3 28.86274
row4 29.61128
row5 51.00415
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.80269 51.39130 49.20936 46.74675 48.86626 104.8345 49.51101 47.51938
row5 50.89322 51.47235 49.18014 49.27382 50.77740 105.0623 51.03845 50.02532
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.40414 49.28474 50.68554 51.02596 48.98488 47.67211 50.23279 49.90713
row5 51.53107 51.00415 51.17448 50.14412 49.52532 50.43477 49.05663 51.67197
col17 col18 col19 col20
row1 50.82384 49.01567 50.03134 105.3092
row5 49.29547 51.32873 50.33088 107.0533
> tmp[,c("col6","col20")]
col6 col20
row1 104.83455 105.30918
row2 74.63615 74.40016
row3 74.28029 76.39617
row4 74.88058 75.45660
row5 105.06226 107.05327
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.8345 105.3092
row5 105.0623 107.0533
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.8345 105.3092
row5 105.0623 107.0533
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.55112922
[2,] 0.02859619
[3,] -0.58687212
[4,] 0.09362898
[5,] 0.64272836
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.73466619 0.5870354
[2,] -0.23060093 1.5528274
[3,] -0.60101361 1.0924079
[4,] -0.24635758 1.4968964
[5,] -0.09217574 0.1006318
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.8108009 -1.0629193
[2,] 1.8052871 -0.2610355
[3,] -0.2400943 1.6985660
[4,] -0.1308259 0.5942614
[5,] -0.7897045 0.0144051
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.8108009
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.8108009
[2,] 1.8052871
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row3 -1.2536327 -0.5011681 -0.5831981 -0.9922392 -0.4011238 -0.6252022
row1 -0.7022496 0.3263037 0.3147010 -1.4816698 1.3771410 1.1098410
[,7] [,8] [,9] [,10] [,11] [,12]
row3 1.9432461 -0.4644816 0.4467595 2.5667185 -0.4407558 -0.7735559
row1 0.2967085 1.6220976 -0.2080947 0.7016447 1.4597149 0.1965238
[,13] [,14] [,15] [,16] [,17] [,18]
row3 0.01495341 0.2772690 0.5528204 0.4710389 -0.6674485 1.1688560
row1 -1.33364633 0.9589921 -1.5831127 0.6267841 -0.7223295 -0.2875184
[,19] [,20]
row3 0.4065598 -0.4518000
row1 -1.7571314 -0.3383684
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.1592543 -0.91231 -0.1705656 -0.204721 0.7599239 -0.8988739 -0.5162923
[,8] [,9] [,10]
row2 -0.4441125 0.586587 1.260978
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.3150981 -0.9846723 -0.2941436 1.360605 0.2140196 -0.7462359 0.7149596
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.8362266 0.5869313 -0.294188 0.9077253 -0.0503626 0.9580083 0.01078378
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.1005541 -0.2009974 0.5412146 -0.9855306 -0.03113664 -0.5490336
>
>
> 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: 0x6000012ec180>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e6617676a58"
[2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e66676c369"
[3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e665f1725cf"
[4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e6668b369ce"
[5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e665ae78915"
[6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e6616d8f053"
[7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e667c89e4dc"
[8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e6641106764"
[9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e661bf3f79b"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e662e04ef73"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e6646047e9f"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e6651151ca2"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e66410af944"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e66377300b8"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8e665f344c78"
>
>
> ### 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: 0x6000012c47e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000012c47e0>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x6000012c47e0>
> rowMedians(tmp)
[1] -0.4235369339 0.2876467214 0.5914287502 0.6958523442 0.1439760243
[6] -0.0983141799 0.3361541387 0.0556201243 -0.0265042170 0.3816027677
[11] 0.0732980456 -0.1712678993 0.1291035549 0.4419757530 -0.0572842634
[16] 0.2501457756 0.1154503558 0.0746766140 -0.0874037452 0.0987202880
[21] -0.5977532340 -0.0424759425 -0.2033310418 0.2666554862 0.1958485120
[26] 0.4229245829 -0.1261501005 -0.1041417734 -0.3333392706 -0.1594747408
[31] -0.2573183883 -0.1501265333 0.3361348036 0.6730670969 -0.1023055649
[36] -0.0965645167 0.1219386471 -0.1230714930 0.4836148137 -0.2665549770
[41] -0.1233543526 0.4503434429 0.0560643949 0.0343482293 0.4353960979
[46] 0.1341208832 0.0147199574 0.0989010216 0.1691636232 -0.2232573828
[51] 0.3015822606 -0.5958152907 -0.0595582434 -0.2435621119 -0.3361416483
[56] 0.4489571818 -0.0793854465 -0.2904271405 0.0854146659 -0.3323490206
[61] -0.0442586943 -0.2416489554 -0.3101451516 0.2701478476 -0.0556299806
[66] -0.0258955870 0.5388433207 -0.1711417307 -0.3453200837 0.1728526836
[71] -0.1506168751 0.6016602636 0.0633008754 -0.0833934882 -0.1453821936
[76] 0.1033705962 0.2813162595 -0.4336920052 -0.0497137493 0.4262166393
[81] -0.0062585342 -0.3524541714 -0.1905261698 -0.3071049810 0.1890028371
[86] -0.4147882336 -0.5285891928 0.3055365250 -0.5727180447 0.2787193227
[91] 0.3494129169 -0.3232060882 0.1698631339 0.2753457899 -0.2240736504
[96] 0.1502981448 0.0606607054 -0.4986969014 -0.4555299267 0.2610976278
[101] -0.2889633895 0.0650774551 0.3575677690 0.2726682037 -0.0589173931
[106] -0.1373733270 -0.0823893287 0.1163840045 -0.0769609446 0.0602184372
[111] 0.2636948914 -0.1191862273 -0.1921900026 0.1024134851 -0.5012786719
[116] 0.3911405569 0.0918384881 -0.1336820731 -0.0002901843 -0.1106469041
[121] -0.0023426840 -0.0228836960 0.1303370659 0.0807358975 -0.2597896693
[126] -0.1044136937 0.4415485714 -0.3336472874 -0.3165969640 -0.0915297273
[131] -0.5225193357 -0.2378848116 0.2024202813 -0.1518492308 0.4799742213
[136] -0.2654032662 -0.4656978850 -0.1237336183 -0.2096891003 -0.3951699471
[141] 0.0634359191 -0.2570032934 0.2357091263 -0.2760011830 0.1867975783
[146] 0.0549120730 -0.0969647641 0.4446010907 -0.2976782583 -0.2600393613
[151] -0.1468252711 -0.1196132557 -0.4354993131 -0.3723124831 -0.3393905735
[156] -0.1129923566 -0.2143838874 -0.0704133752 0.0376455185 0.2329430918
[161] 0.4043489575 0.0681884585 -0.4506063121 0.0609984463 0.4648071012
[166] -0.2038534177 0.1954539153 -0.5129756024 0.0805066721 -0.4745547537
[171] -0.2925075685 0.1813899336 0.2423871262 -0.1956080432 0.0786813748
[176] -0.2219923909 -0.2384554407 -0.8995310146 -0.3210872214 -0.2689016093
[181] -0.0931347295 -0.3041556284 0.2044907589 -0.2958246941 -0.3025556477
[186] 0.0707498401 -0.5503479646 -0.2730989440 -0.3070667686 -0.1449822355
[191] 0.0123585849 0.4114100182 0.4470151111 0.5775272036 -0.3844251911
[196] 0.1432441124 0.0805059682 0.4899205074 -0.1230405459 -0.0041890954
[201] 0.8570894639 0.1548786800 -0.3748724509 -0.1611191673 0.0871893179
[206] 0.1549957524 -0.0781274725 0.3077221606 -0.0142910120 -0.3719701694
[211] 0.0584936332 -0.6172585050 0.2838803126 0.1887384584 0.1302564869
[216] -0.6128556283 0.1735187691 0.3217677157 -0.1780406135 0.0592730494
[221] 0.1099143554 -1.0539837636 0.3007176355 -0.3246432412 -0.0146846721
[226] 0.0673229621 -0.4857064035 0.3228638360 -0.6535270650 -0.1805260587
>
> proc.time()
user system elapsed
2.183 9.471 15.766
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: 0x600002a740c0>
> .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: 0x600002a740c0>
> .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: 0x600002a740c0>
> .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: 0x600002a740c0>
> 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: 0x600002a700c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002a700c0>
> .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: 0x600002a700c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002a700c0>
> .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: 0x600002a700c0>
> 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: 0x600002a70240>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002a70240>
> .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: 0x600002a70240>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002a70240>
> .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: 0x600002a70240>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x600002a70240>
> .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: 0x600002a70240>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x600002a70240>
> .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: 0x600002a70240>
> 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: 0x600002a600c0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600002a600c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002a600c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002a600c0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile941a599bee2f" "BufferedMatrixFile941a8120f14"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile941a599bee2f" "BufferedMatrixFile941a8120f14"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002a442a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002a442a0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002a442a0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002a442a0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600002a442a0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600002a442a0>
> .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: 0x600002a44480>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002a44480>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002a44480>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600002a44480>
> 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: 0x600002a44660>
> .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: 0x600002a44660>
> rm(P)
>
> proc.time()
user system elapsed
0.335 0.111 0.615
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.344 0.072 0.449