| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-12-11 12:05 -0500 (Thu, 11 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" | 4879 |
| merida1 | macOS 12.7.6 Monterey | x86_64 | 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble" | 4670 |
| kjohnson1 | macOS 13.7.5 Ventura | arm64 | 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble" | 4604 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4669 |
| 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-09 16:48:15 -0500 (Tue, 09 Dec 2025) |
| EndedAt: 2025-12-09 16:49:08 -0500 (Tue, 09 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.340 0.107 0.522
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 9 16:48:40 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 9 16:48:40 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: 0x600000940060>
>
>
>
> 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 9 16:48:44 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 9 16:48:46 2025"
>
> ColMode(tmp2)
<pointer: 0x600000940060>
>
>
>
> ### 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.63314333 -0.4145533 0.7059868 0.1389808
[2,] -0.52185938 -1.0697729 -0.1091905 0.3955309
[3,] 0.02615079 0.6761796 -0.5434141 -1.2095117
[4,] -1.20066260 -0.1556103 -0.6747414 -2.8760902
> 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.63314333 0.4145533 0.7059868 0.1389808
[2,] 0.52185938 1.0697729 0.1091905 0.3955309
[3,] 0.02615079 0.6761796 0.5434141 1.2095117
[4,] 1.20066260 0.1556103 0.6747414 2.8760902
> 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.0316072 0.6438581 0.8402302 0.3728012
[2,] 0.7223984 1.0342983 0.3304398 0.6289125
[3,] 0.1617121 0.8223014 0.7371662 1.0997780
[4,] 1.0957475 0.3944747 0.8214265 1.6959039
>
> 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.94922 31.85313 34.10829 28.86699
[2,] 32.74584 36.41276 28.41359 31.68466
[3,] 26.64327 33.89919 32.91508 37.20729
[4,] 37.15814 29.10036 33.88901 44.83513
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000964300>
> exp(tmp5)
<pointer: 0x600000964300>
> log(tmp5,2)
<pointer: 0x600000964300>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 470.2837
> Min(tmp5)
[1] 53.56552
> mean(tmp5)
[1] 72.34227
> Sum(tmp5)
[1] 14468.45
> Var(tmp5)
[1] 874.5059
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 88.55651 71.45105 69.04449 70.45333 68.26926 72.58538 72.72601 71.91173
[9] 68.57149 69.85348
> rowSums(tmp5)
[1] 1771.130 1429.021 1380.890 1409.067 1365.385 1451.708 1454.520 1438.235
[9] 1371.430 1397.070
> rowVars(tmp5)
[1] 8136.40492 45.67706 93.11470 99.26887 77.29865 57.52109
[7] 74.45801 84.87063 59.77808 98.76596
> rowSd(tmp5)
[1] 90.202023 6.758481 9.649596 9.963377 8.791965 7.584266 8.628905
[8] 9.212526 7.731629 9.938106
> rowMax(tmp5)
[1] 470.28369 85.04901 93.10871 93.31845 86.83743 86.85683 87.50116
[8] 92.68287 88.07952 92.00858
> rowMin(tmp5)
[1] 54.62580 59.13916 53.80215 53.56552 53.97679 60.76296 60.24550 53.96558
[9] 53.83426 54.26452
>
> colMeans(tmp5)
[1] 107.40473 72.65586 69.53609 69.60830 69.45035 68.89159 65.51840
[8] 68.49232 72.62343 71.99853 71.60386 69.88802 64.96675 69.84197
[15] 79.80033 74.76404 66.62926 70.04947 74.14672 68.97543
> colSums(tmp5)
[1] 1074.0473 726.5586 695.3609 696.0830 694.5035 688.9159 655.1840
[8] 684.9232 726.2343 719.9853 716.0386 698.8802 649.6675 698.4197
[15] 798.0033 747.6404 666.2926 700.4947 741.4672 689.7543
> colVars(tmp5)
[1] 16324.77735 107.87904 32.02585 94.58966 40.61811 47.95517
[7] 54.69184 100.98598 75.27581 77.00692 89.40080 49.09744
[13] 55.95149 34.42658 59.27785 94.91702 84.76297 72.68643
[19] 78.36402 86.19251
> colSd(tmp5)
[1] 127.768452 10.386483 5.659139 9.725721 6.373234 6.924967
[7] 7.395393 10.049178 8.676163 8.775358 9.455199 7.006957
[13] 7.480073 5.867417 7.699211 9.742537 9.206681 8.525634
[19] 8.852345 9.283992
> colMax(tmp5)
[1] 470.28369 90.15792 75.25223 93.31845 80.44675 78.53042 76.57107
[8] 85.92833 86.83743 83.00268 92.68287 87.13164 75.39133 75.35341
[15] 93.10871 92.00858 86.58735 82.76715 87.50116 83.86321
> colMin(tmp5)
[1] 53.97679 60.56858 59.13916 60.08286 62.92059 57.87612 54.62580 54.26452
[9] 61.79987 55.77316 61.71987 62.91801 53.83426 57.19439 68.74545 61.65368
[17] 53.80215 53.56552 55.98557 53.96558
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 88.55651 71.45105 69.04449 70.45333 NA 72.58538 72.72601 71.91173
[9] 68.57149 69.85348
> rowSums(tmp5)
[1] 1771.130 1429.021 1380.890 1409.067 NA 1451.708 1454.520 1438.235
[9] 1371.430 1397.070
> rowVars(tmp5)
[1] 8136.40492 45.67706 93.11470 99.26887 80.18642 57.52109
[7] 74.45801 84.87063 59.77808 98.76596
> rowSd(tmp5)
[1] 90.202023 6.758481 9.649596 9.963377 8.954687 7.584266 8.628905
[8] 9.212526 7.731629 9.938106
> rowMax(tmp5)
[1] 470.28369 85.04901 93.10871 93.31845 NA 86.85683 87.50116
[8] 92.68287 88.07952 92.00858
> rowMin(tmp5)
[1] 54.62580 59.13916 53.80215 53.56552 NA 60.76296 60.24550 53.96558
[9] 53.83426 54.26452
>
> colMeans(tmp5)
[1] 107.40473 72.65586 69.53609 69.60830 NA 68.89159 65.51840
[8] 68.49232 72.62343 71.99853 71.60386 69.88802 64.96675 69.84197
[15] 79.80033 74.76404 66.62926 70.04947 74.14672 68.97543
> colSums(tmp5)
[1] 1074.0473 726.5586 695.3609 696.0830 NA 688.9159 655.1840
[8] 684.9232 726.2343 719.9853 716.0386 698.8802 649.6675 698.4197
[15] 798.0033 747.6404 666.2926 700.4947 741.4672 689.7543
> colVars(tmp5)
[1] 16324.77735 107.87904 32.02585 94.58966 NA 47.95517
[7] 54.69184 100.98598 75.27581 77.00692 89.40080 49.09744
[13] 55.95149 34.42658 59.27785 94.91702 84.76297 72.68643
[19] 78.36402 86.19251
> colSd(tmp5)
[1] 127.768452 10.386483 5.659139 9.725721 NA 6.924967
[7] 7.395393 10.049178 8.676163 8.775358 9.455199 7.006957
[13] 7.480073 5.867417 7.699211 9.742537 9.206681 8.525634
[19] 8.852345 9.283992
> colMax(tmp5)
[1] 470.28369 90.15792 75.25223 93.31845 NA 78.53042 76.57107
[8] 85.92833 86.83743 83.00268 92.68287 87.13164 75.39133 75.35341
[15] 93.10871 92.00858 86.58735 82.76715 87.50116 83.86321
> colMin(tmp5)
[1] 53.97679 60.56858 59.13916 60.08286 NA 57.87612 54.62580 54.26452
[9] 61.79987 55.77316 61.71987 62.91801 53.83426 57.19439 68.74545 61.65368
[17] 53.80215 53.56552 55.98557 53.96558
>
> Max(tmp5,na.rm=TRUE)
[1] 470.2837
> Min(tmp5,na.rm=TRUE)
[1] 53.56552
> mean(tmp5,na.rm=TRUE)
[1] 72.38738
> Sum(tmp5,na.rm=TRUE)
[1] 14405.09
> Var(tmp5,na.rm=TRUE)
[1] 878.5135
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 88.55651 71.45105 69.04449 70.45333 68.52739 72.58538 72.72601 71.91173
[9] 68.57149 69.85348
> rowSums(tmp5,na.rm=TRUE)
[1] 1771.130 1429.021 1380.890 1409.067 1302.020 1451.708 1454.520 1438.235
[9] 1371.430 1397.070
> rowVars(tmp5,na.rm=TRUE)
[1] 8136.40492 45.67706 93.11470 99.26887 80.18642 57.52109
[7] 74.45801 84.87063 59.77808 98.76596
> rowSd(tmp5,na.rm=TRUE)
[1] 90.202023 6.758481 9.649596 9.963377 8.954687 7.584266 8.628905
[8] 9.212526 7.731629 9.938106
> rowMax(tmp5,na.rm=TRUE)
[1] 470.28369 85.04901 93.10871 93.31845 86.83743 86.85683 87.50116
[8] 92.68287 88.07952 92.00858
> rowMin(tmp5,na.rm=TRUE)
[1] 54.62580 59.13916 53.80215 53.56552 53.97679 60.76296 60.24550 53.96558
[9] 53.83426 54.26452
>
> colMeans(tmp5,na.rm=TRUE)
[1] 107.40473 72.65586 69.53609 69.60830 70.12651 68.89159 65.51840
[8] 68.49232 72.62343 71.99853 71.60386 69.88802 64.96675 69.84197
[15] 79.80033 74.76404 66.62926 70.04947 74.14672 68.97543
> colSums(tmp5,na.rm=TRUE)
[1] 1074.0473 726.5586 695.3609 696.0830 631.1386 688.9159 655.1840
[8] 684.9232 726.2343 719.9853 716.0386 698.8802 649.6675 698.4197
[15] 798.0033 747.6404 666.2926 700.4947 741.4672 689.7543
> colVars(tmp5,na.rm=TRUE)
[1] 16324.77735 107.87904 32.02585 94.58966 40.55194 47.95517
[7] 54.69184 100.98598 75.27581 77.00692 89.40080 49.09744
[13] 55.95149 34.42658 59.27785 94.91702 84.76297 72.68643
[19] 78.36402 86.19251
> colSd(tmp5,na.rm=TRUE)
[1] 127.768452 10.386483 5.659139 9.725721 6.368040 6.924967
[7] 7.395393 10.049178 8.676163 8.775358 9.455199 7.006957
[13] 7.480073 5.867417 7.699211 9.742537 9.206681 8.525634
[19] 8.852345 9.283992
> colMax(tmp5,na.rm=TRUE)
[1] 470.28369 90.15792 75.25223 93.31845 80.44675 78.53042 76.57107
[8] 85.92833 86.83743 83.00268 92.68287 87.13164 75.39133 75.35341
[15] 93.10871 92.00858 86.58735 82.76715 87.50116 83.86321
> colMin(tmp5,na.rm=TRUE)
[1] 53.97679 60.56858 59.13916 60.08286 62.92059 57.87612 54.62580 54.26452
[9] 61.79987 55.77316 61.71987 62.91801 53.83426 57.19439 68.74545 61.65368
[17] 53.80215 53.56552 55.98557 53.96558
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 88.55651 71.45105 69.04449 70.45333 NaN 72.58538 72.72601 71.91173
[9] 68.57149 69.85348
> rowSums(tmp5,na.rm=TRUE)
[1] 1771.130 1429.021 1380.890 1409.067 0.000 1451.708 1454.520 1438.235
[9] 1371.430 1397.070
> rowVars(tmp5,na.rm=TRUE)
[1] 8136.40492 45.67706 93.11470 99.26887 NA 57.52109
[7] 74.45801 84.87063 59.77808 98.76596
> rowSd(tmp5,na.rm=TRUE)
[1] 90.202023 6.758481 9.649596 9.963377 NA 7.584266 8.628905
[8] 9.212526 7.731629 9.938106
> rowMax(tmp5,na.rm=TRUE)
[1] 470.28369 85.04901 93.10871 93.31845 NA 86.85683 87.50116
[8] 92.68287 88.07952 92.00858
> rowMin(tmp5,na.rm=TRUE)
[1] 54.62580 59.13916 53.80215 53.56552 NA 60.76296 60.24550 53.96558
[9] 53.83426 54.26452
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 113.34117 72.04771 68.90096 69.49635 NaN 70.11553 66.02809
[8] 69.14689 71.04410 72.22956 71.12746 70.66246 64.64700 69.41589
[15] 80.39561 75.98179 66.71468 70.79617 76.16462 67.51402
> colSums(tmp5,na.rm=TRUE)
[1] 1020.0705 648.4294 620.1086 625.4671 0.0000 631.0397 594.2528
[8] 622.3220 639.3969 650.0660 640.1471 635.9622 581.8230 624.7430
[15] 723.5605 683.8361 600.4321 637.1656 685.4816 607.6262
> colVars(tmp5,na.rm=TRUE)
[1] 17968.91001 117.20315 31.49098 106.27236 NA 37.09672
[7] 58.60567 108.78904 56.62451 86.03235 98.02268 48.48725
[13] 61.79526 36.68754 62.70113 90.09893 95.27625 75.49960
[19] 42.35016 72.93970
> colSd(tmp5,na.rm=TRUE)
[1] 134.048163 10.826040 5.611683 10.308849 NA 6.090708
[7] 7.655434 10.430198 7.524926 9.275362 9.900640 6.963279
[13] 7.860996 6.057024 7.918405 9.492046 9.760955 8.689051
[19] 6.507700 8.540474
> colMax(tmp5,na.rm=TRUE)
[1] 470.28369 90.15792 75.20475 93.31845 -Inf 78.53042 76.57107
[8] 85.92833 85.04901 83.00268 92.68287 87.13164 75.39133 75.35341
[15] 93.10871 92.00858 86.58735 82.76715 87.50116 83.86321
> colMin(tmp5,na.rm=TRUE)
[1] 55.45448 60.56858 59.13916 60.08286 Inf 60.11721 54.62580 54.26452
[9] 61.79987 55.77316 61.71987 63.19850 53.83426 57.19439 68.74545 61.65368
[17] 53.80215 53.56552 64.97025 53.96558
>
>
>
>
> 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] 237.6754 371.3647 237.1547 134.4684 167.7109 302.2969 294.9108 203.0766
[9] 210.8131 125.0955
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 237.6754 371.3647 237.1547 134.4684 167.7109 302.2969 294.9108 203.0766
[9] 210.8131 125.0955
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] -5.684342e-14 -2.842171e-14 -5.684342e-14 -1.136868e-13 5.684342e-14
[6] -8.526513e-14 2.842171e-14 -5.684342e-14 1.136868e-13 -1.278977e-13
[11] -9.947598e-14 -4.263256e-14 4.263256e-14 8.526513e-14 -8.526513e-14
[16] 2.842171e-14 5.684342e-14 -1.421085e-14 -8.526513e-14 8.526513e-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)
+ }
2 5
6 1
1 7
9 13
3 6
5 6
3 11
4 16
6 16
5 14
4 7
2 6
10 7
5 9
3 10
6 10
5 16
6 14
8 6
9 16
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 2.533057
> Min(tmp)
[1] -1.997554
> mean(tmp)
[1] -0.07659137
> Sum(tmp)
[1] -7.659137
> Var(tmp)
[1] 0.9463683
>
> rowMeans(tmp)
[1] -0.07659137
> rowSums(tmp)
[1] -7.659137
> rowVars(tmp)
[1] 0.9463683
> rowSd(tmp)
[1] 0.9728146
> rowMax(tmp)
[1] 2.533057
> rowMin(tmp)
[1] -1.997554
>
> colMeans(tmp)
[1] 1.06998008 -0.94547746 1.27860759 0.99461238 0.01523797 -0.79651810
[7] -0.26421040 -1.18900656 -0.72071015 0.36894137 -0.80430751 0.70073296
[13] 0.84270630 0.67328507 -0.32834738 -0.06771572 -0.68447788 -0.02991811
[19] -1.14890642 -0.21711601 -1.03230487 -1.19464861 1.85560771 1.02922012
[25] 0.67485178 1.62748647 -1.98169394 0.03597662 -0.90603820 1.75884406
[31] -1.09533066 -0.19610074 -0.72705331 1.68452037 0.62914869 -0.48913136
[37] 2.48314368 0.72457080 -0.67200513 -1.72386136 1.03859078 -0.30180892
[43] 0.24821793 2.53305723 -0.40949534 -0.78579924 0.71941315 -0.68136849
[49] -0.50956468 -0.87192823 0.28639889 -0.75628156 -0.28079935 0.72152196
[55] 0.64784634 -0.80063233 0.93859307 -1.58573991 -0.26492340 -0.25382386
[61] -0.03826565 -0.95740787 -1.76999301 1.61085552 -0.87728670 0.76977110
[67] 1.43053304 -1.22478680 0.41217955 0.32461266 -0.45052087 -0.87507500
[73] -1.64131097 0.15809309 1.78461260 -0.43559803 0.24955279 -0.44537173
[79] -0.63647740 -0.46786326 -1.99755383 0.22394684 -0.26556235 -0.01176487
[85] -0.89672596 0.50223056 -0.99909544 -0.34774987 0.02514995 -0.76903053
[91] -0.47678801 -0.58746609 0.45830546 1.01723055 0.15682990 0.27600198
[97] -1.28136396 -1.14915436 -0.45062591 1.12972768
> colSums(tmp)
[1] 1.06998008 -0.94547746 1.27860759 0.99461238 0.01523797 -0.79651810
[7] -0.26421040 -1.18900656 -0.72071015 0.36894137 -0.80430751 0.70073296
[13] 0.84270630 0.67328507 -0.32834738 -0.06771572 -0.68447788 -0.02991811
[19] -1.14890642 -0.21711601 -1.03230487 -1.19464861 1.85560771 1.02922012
[25] 0.67485178 1.62748647 -1.98169394 0.03597662 -0.90603820 1.75884406
[31] -1.09533066 -0.19610074 -0.72705331 1.68452037 0.62914869 -0.48913136
[37] 2.48314368 0.72457080 -0.67200513 -1.72386136 1.03859078 -0.30180892
[43] 0.24821793 2.53305723 -0.40949534 -0.78579924 0.71941315 -0.68136849
[49] -0.50956468 -0.87192823 0.28639889 -0.75628156 -0.28079935 0.72152196
[55] 0.64784634 -0.80063233 0.93859307 -1.58573991 -0.26492340 -0.25382386
[61] -0.03826565 -0.95740787 -1.76999301 1.61085552 -0.87728670 0.76977110
[67] 1.43053304 -1.22478680 0.41217955 0.32461266 -0.45052087 -0.87507500
[73] -1.64131097 0.15809309 1.78461260 -0.43559803 0.24955279 -0.44537173
[79] -0.63647740 -0.46786326 -1.99755383 0.22394684 -0.26556235 -0.01176487
[85] -0.89672596 0.50223056 -0.99909544 -0.34774987 0.02514995 -0.76903053
[91] -0.47678801 -0.58746609 0.45830546 1.01723055 0.15682990 0.27600198
[97] -1.28136396 -1.14915436 -0.45062591 1.12972768
> 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] 1.06998008 -0.94547746 1.27860759 0.99461238 0.01523797 -0.79651810
[7] -0.26421040 -1.18900656 -0.72071015 0.36894137 -0.80430751 0.70073296
[13] 0.84270630 0.67328507 -0.32834738 -0.06771572 -0.68447788 -0.02991811
[19] -1.14890642 -0.21711601 -1.03230487 -1.19464861 1.85560771 1.02922012
[25] 0.67485178 1.62748647 -1.98169394 0.03597662 -0.90603820 1.75884406
[31] -1.09533066 -0.19610074 -0.72705331 1.68452037 0.62914869 -0.48913136
[37] 2.48314368 0.72457080 -0.67200513 -1.72386136 1.03859078 -0.30180892
[43] 0.24821793 2.53305723 -0.40949534 -0.78579924 0.71941315 -0.68136849
[49] -0.50956468 -0.87192823 0.28639889 -0.75628156 -0.28079935 0.72152196
[55] 0.64784634 -0.80063233 0.93859307 -1.58573991 -0.26492340 -0.25382386
[61] -0.03826565 -0.95740787 -1.76999301 1.61085552 -0.87728670 0.76977110
[67] 1.43053304 -1.22478680 0.41217955 0.32461266 -0.45052087 -0.87507500
[73] -1.64131097 0.15809309 1.78461260 -0.43559803 0.24955279 -0.44537173
[79] -0.63647740 -0.46786326 -1.99755383 0.22394684 -0.26556235 -0.01176487
[85] -0.89672596 0.50223056 -0.99909544 -0.34774987 0.02514995 -0.76903053
[91] -0.47678801 -0.58746609 0.45830546 1.01723055 0.15682990 0.27600198
[97] -1.28136396 -1.14915436 -0.45062591 1.12972768
> colMin(tmp)
[1] 1.06998008 -0.94547746 1.27860759 0.99461238 0.01523797 -0.79651810
[7] -0.26421040 -1.18900656 -0.72071015 0.36894137 -0.80430751 0.70073296
[13] 0.84270630 0.67328507 -0.32834738 -0.06771572 -0.68447788 -0.02991811
[19] -1.14890642 -0.21711601 -1.03230487 -1.19464861 1.85560771 1.02922012
[25] 0.67485178 1.62748647 -1.98169394 0.03597662 -0.90603820 1.75884406
[31] -1.09533066 -0.19610074 -0.72705331 1.68452037 0.62914869 -0.48913136
[37] 2.48314368 0.72457080 -0.67200513 -1.72386136 1.03859078 -0.30180892
[43] 0.24821793 2.53305723 -0.40949534 -0.78579924 0.71941315 -0.68136849
[49] -0.50956468 -0.87192823 0.28639889 -0.75628156 -0.28079935 0.72152196
[55] 0.64784634 -0.80063233 0.93859307 -1.58573991 -0.26492340 -0.25382386
[61] -0.03826565 -0.95740787 -1.76999301 1.61085552 -0.87728670 0.76977110
[67] 1.43053304 -1.22478680 0.41217955 0.32461266 -0.45052087 -0.87507500
[73] -1.64131097 0.15809309 1.78461260 -0.43559803 0.24955279 -0.44537173
[79] -0.63647740 -0.46786326 -1.99755383 0.22394684 -0.26556235 -0.01176487
[85] -0.89672596 0.50223056 -0.99909544 -0.34774987 0.02514995 -0.76903053
[91] -0.47678801 -0.58746609 0.45830546 1.01723055 0.15682990 0.27600198
[97] -1.28136396 -1.14915436 -0.45062591 1.12972768
> colMedians(tmp)
[1] 1.06998008 -0.94547746 1.27860759 0.99461238 0.01523797 -0.79651810
[7] -0.26421040 -1.18900656 -0.72071015 0.36894137 -0.80430751 0.70073296
[13] 0.84270630 0.67328507 -0.32834738 -0.06771572 -0.68447788 -0.02991811
[19] -1.14890642 -0.21711601 -1.03230487 -1.19464861 1.85560771 1.02922012
[25] 0.67485178 1.62748647 -1.98169394 0.03597662 -0.90603820 1.75884406
[31] -1.09533066 -0.19610074 -0.72705331 1.68452037 0.62914869 -0.48913136
[37] 2.48314368 0.72457080 -0.67200513 -1.72386136 1.03859078 -0.30180892
[43] 0.24821793 2.53305723 -0.40949534 -0.78579924 0.71941315 -0.68136849
[49] -0.50956468 -0.87192823 0.28639889 -0.75628156 -0.28079935 0.72152196
[55] 0.64784634 -0.80063233 0.93859307 -1.58573991 -0.26492340 -0.25382386
[61] -0.03826565 -0.95740787 -1.76999301 1.61085552 -0.87728670 0.76977110
[67] 1.43053304 -1.22478680 0.41217955 0.32461266 -0.45052087 -0.87507500
[73] -1.64131097 0.15809309 1.78461260 -0.43559803 0.24955279 -0.44537173
[79] -0.63647740 -0.46786326 -1.99755383 0.22394684 -0.26556235 -0.01176487
[85] -0.89672596 0.50223056 -0.99909544 -0.34774987 0.02514995 -0.76903053
[91] -0.47678801 -0.58746609 0.45830546 1.01723055 0.15682990 0.27600198
[97] -1.28136396 -1.14915436 -0.45062591 1.12972768
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 1.06998 -0.9454775 1.278608 0.9946124 0.01523797 -0.7965181 -0.2642104
[2,] 1.06998 -0.9454775 1.278608 0.9946124 0.01523797 -0.7965181 -0.2642104
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -1.189007 -0.7207101 0.3689414 -0.8043075 0.700733 0.8427063 0.6732851
[2,] -1.189007 -0.7207101 0.3689414 -0.8043075 0.700733 0.8427063 0.6732851
[,15] [,16] [,17] [,18] [,19] [,20]
[1,] -0.3283474 -0.06771572 -0.6844779 -0.02991811 -1.148906 -0.217116
[2,] -0.3283474 -0.06771572 -0.6844779 -0.02991811 -1.148906 -0.217116
[,21] [,22] [,23] [,24] [,25] [,26] [,27]
[1,] -1.032305 -1.194649 1.855608 1.02922 0.6748518 1.627486 -1.981694
[2,] -1.032305 -1.194649 1.855608 1.02922 0.6748518 1.627486 -1.981694
[,28] [,29] [,30] [,31] [,32] [,33] [,34]
[1,] 0.03597662 -0.9060382 1.758844 -1.095331 -0.1961007 -0.7270533 1.68452
[2,] 0.03597662 -0.9060382 1.758844 -1.095331 -0.1961007 -0.7270533 1.68452
[,35] [,36] [,37] [,38] [,39] [,40] [,41]
[1,] 0.6291487 -0.4891314 2.483144 0.7245708 -0.6720051 -1.723861 1.038591
[2,] 0.6291487 -0.4891314 2.483144 0.7245708 -0.6720051 -1.723861 1.038591
[,42] [,43] [,44] [,45] [,46] [,47] [,48]
[1,] -0.3018089 0.2482179 2.533057 -0.4094953 -0.7857992 0.7194132 -0.6813685
[2,] -0.3018089 0.2482179 2.533057 -0.4094953 -0.7857992 0.7194132 -0.6813685
[,49] [,50] [,51] [,52] [,53] [,54] [,55]
[1,] -0.5095647 -0.8719282 0.2863989 -0.7562816 -0.2807994 0.721522 0.6478463
[2,] -0.5095647 -0.8719282 0.2863989 -0.7562816 -0.2807994 0.721522 0.6478463
[,56] [,57] [,58] [,59] [,60] [,61] [,62]
[1,] -0.8006323 0.9385931 -1.58574 -0.2649234 -0.2538239 -0.03826565 -0.9574079
[2,] -0.8006323 0.9385931 -1.58574 -0.2649234 -0.2538239 -0.03826565 -0.9574079
[,63] [,64] [,65] [,66] [,67] [,68] [,69]
[1,] -1.769993 1.610856 -0.8772867 0.7697711 1.430533 -1.224787 0.4121796
[2,] -1.769993 1.610856 -0.8772867 0.7697711 1.430533 -1.224787 0.4121796
[,70] [,71] [,72] [,73] [,74] [,75] [,76]
[1,] 0.3246127 -0.4505209 -0.875075 -1.641311 0.1580931 1.784613 -0.435598
[2,] 0.3246127 -0.4505209 -0.875075 -1.641311 0.1580931 1.784613 -0.435598
[,77] [,78] [,79] [,80] [,81] [,82] [,83]
[1,] 0.2495528 -0.4453717 -0.6364774 -0.4678633 -1.997554 0.2239468 -0.2655624
[2,] 0.2495528 -0.4453717 -0.6364774 -0.4678633 -1.997554 0.2239468 -0.2655624
[,84] [,85] [,86] [,87] [,88] [,89]
[1,] -0.01176487 -0.896726 0.5022306 -0.9990954 -0.3477499 0.02514995
[2,] -0.01176487 -0.896726 0.5022306 -0.9990954 -0.3477499 0.02514995
[,90] [,91] [,92] [,93] [,94] [,95] [,96]
[1,] -0.7690305 -0.476788 -0.5874661 0.4583055 1.017231 0.1568299 0.276002
[2,] -0.7690305 -0.476788 -0.5874661 0.4583055 1.017231 0.1568299 0.276002
[,97] [,98] [,99] [,100]
[1,] -1.281364 -1.149154 -0.4506259 1.129728
[2,] -1.281364 -1.149154 -0.4506259 1.129728
>
>
> Max(tmp2)
[1] 3.164877
> Min(tmp2)
[1] -2.636845
> mean(tmp2)
[1] 0.05440749
> Sum(tmp2)
[1] 5.440749
> Var(tmp2)
[1] 1.322277
>
> rowMeans(tmp2)
[1] -0.62608557 -1.31295216 1.10645010 -0.07932144 -2.43191299 0.84971077
[7] 0.78171660 0.34623785 -0.79518285 -0.76156042 -0.42991598 0.93523436
[13] -2.19432830 -0.05897144 0.08618685 1.55193246 0.54732459 -1.22511883
[19] -0.58821457 1.45050504 -0.96997373 0.76199111 1.55851748 0.18740456
[25] 0.01822659 -2.63684481 -0.50660172 0.03679547 1.83639149 2.46638377
[31] 0.72083780 -0.46005860 0.07621919 0.21891847 1.10808743 0.46085544
[37] -0.28486312 -0.23060868 -1.05484604 0.31527445 -1.10023201 -0.51346505
[43] 0.60354209 -1.16494074 3.16487678 -0.18000970 -0.04771555 -2.49936388
[49] 1.10348100 0.03749304 0.55644617 -0.47718446 2.35066637 -0.65155248
[55] 0.91099034 1.18647975 -1.02579640 0.46520294 -0.80433987 1.56808883
[61] -1.44127445 -0.63514989 0.43364192 2.04773254 -1.08510256 -0.44526602
[67] 0.96178111 1.23184268 -0.68833582 -0.87911206 -0.02095052 0.43416894
[73] 0.29761956 -1.16426838 0.46331174 -0.36215633 2.31032609 -1.52307016
[79] -0.27716488 -0.90553847 1.42467232 -0.67410579 0.55611572 -0.25927318
[85] 1.16650007 1.16732013 -0.71103164 0.53313986 1.68728585 0.34584956
[91] 0.47373057 -2.18806637 -0.83840050 -2.32666719 0.46336686 2.29631663
[97] -0.25071670 0.13934011 -0.41315804 -0.16101241
> rowSums(tmp2)
[1] -0.62608557 -1.31295216 1.10645010 -0.07932144 -2.43191299 0.84971077
[7] 0.78171660 0.34623785 -0.79518285 -0.76156042 -0.42991598 0.93523436
[13] -2.19432830 -0.05897144 0.08618685 1.55193246 0.54732459 -1.22511883
[19] -0.58821457 1.45050504 -0.96997373 0.76199111 1.55851748 0.18740456
[25] 0.01822659 -2.63684481 -0.50660172 0.03679547 1.83639149 2.46638377
[31] 0.72083780 -0.46005860 0.07621919 0.21891847 1.10808743 0.46085544
[37] -0.28486312 -0.23060868 -1.05484604 0.31527445 -1.10023201 -0.51346505
[43] 0.60354209 -1.16494074 3.16487678 -0.18000970 -0.04771555 -2.49936388
[49] 1.10348100 0.03749304 0.55644617 -0.47718446 2.35066637 -0.65155248
[55] 0.91099034 1.18647975 -1.02579640 0.46520294 -0.80433987 1.56808883
[61] -1.44127445 -0.63514989 0.43364192 2.04773254 -1.08510256 -0.44526602
[67] 0.96178111 1.23184268 -0.68833582 -0.87911206 -0.02095052 0.43416894
[73] 0.29761956 -1.16426838 0.46331174 -0.36215633 2.31032609 -1.52307016
[79] -0.27716488 -0.90553847 1.42467232 -0.67410579 0.55611572 -0.25927318
[85] 1.16650007 1.16732013 -0.71103164 0.53313986 1.68728585 0.34584956
[91] 0.47373057 -2.18806637 -0.83840050 -2.32666719 0.46336686 2.29631663
[97] -0.25071670 0.13934011 -0.41315804 -0.16101241
> 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.62608557 -1.31295216 1.10645010 -0.07932144 -2.43191299 0.84971077
[7] 0.78171660 0.34623785 -0.79518285 -0.76156042 -0.42991598 0.93523436
[13] -2.19432830 -0.05897144 0.08618685 1.55193246 0.54732459 -1.22511883
[19] -0.58821457 1.45050504 -0.96997373 0.76199111 1.55851748 0.18740456
[25] 0.01822659 -2.63684481 -0.50660172 0.03679547 1.83639149 2.46638377
[31] 0.72083780 -0.46005860 0.07621919 0.21891847 1.10808743 0.46085544
[37] -0.28486312 -0.23060868 -1.05484604 0.31527445 -1.10023201 -0.51346505
[43] 0.60354209 -1.16494074 3.16487678 -0.18000970 -0.04771555 -2.49936388
[49] 1.10348100 0.03749304 0.55644617 -0.47718446 2.35066637 -0.65155248
[55] 0.91099034 1.18647975 -1.02579640 0.46520294 -0.80433987 1.56808883
[61] -1.44127445 -0.63514989 0.43364192 2.04773254 -1.08510256 -0.44526602
[67] 0.96178111 1.23184268 -0.68833582 -0.87911206 -0.02095052 0.43416894
[73] 0.29761956 -1.16426838 0.46331174 -0.36215633 2.31032609 -1.52307016
[79] -0.27716488 -0.90553847 1.42467232 -0.67410579 0.55611572 -0.25927318
[85] 1.16650007 1.16732013 -0.71103164 0.53313986 1.68728585 0.34584956
[91] 0.47373057 -2.18806637 -0.83840050 -2.32666719 0.46336686 2.29631663
[97] -0.25071670 0.13934011 -0.41315804 -0.16101241
> rowMin(tmp2)
[1] -0.62608557 -1.31295216 1.10645010 -0.07932144 -2.43191299 0.84971077
[7] 0.78171660 0.34623785 -0.79518285 -0.76156042 -0.42991598 0.93523436
[13] -2.19432830 -0.05897144 0.08618685 1.55193246 0.54732459 -1.22511883
[19] -0.58821457 1.45050504 -0.96997373 0.76199111 1.55851748 0.18740456
[25] 0.01822659 -2.63684481 -0.50660172 0.03679547 1.83639149 2.46638377
[31] 0.72083780 -0.46005860 0.07621919 0.21891847 1.10808743 0.46085544
[37] -0.28486312 -0.23060868 -1.05484604 0.31527445 -1.10023201 -0.51346505
[43] 0.60354209 -1.16494074 3.16487678 -0.18000970 -0.04771555 -2.49936388
[49] 1.10348100 0.03749304 0.55644617 -0.47718446 2.35066637 -0.65155248
[55] 0.91099034 1.18647975 -1.02579640 0.46520294 -0.80433987 1.56808883
[61] -1.44127445 -0.63514989 0.43364192 2.04773254 -1.08510256 -0.44526602
[67] 0.96178111 1.23184268 -0.68833582 -0.87911206 -0.02095052 0.43416894
[73] 0.29761956 -1.16426838 0.46331174 -0.36215633 2.31032609 -1.52307016
[79] -0.27716488 -0.90553847 1.42467232 -0.67410579 0.55611572 -0.25927318
[85] 1.16650007 1.16732013 -0.71103164 0.53313986 1.68728585 0.34584956
[91] 0.47373057 -2.18806637 -0.83840050 -2.32666719 0.46336686 2.29631663
[97] -0.25071670 0.13934011 -0.41315804 -0.16101241
>
> colMeans(tmp2)
[1] 0.05440749
> colSums(tmp2)
[1] 5.440749
> colVars(tmp2)
[1] 1.322277
> colSd(tmp2)
[1] 1.149903
> colMax(tmp2)
[1] 3.164877
> colMin(tmp2)
[1] -2.636845
> colMedians(tmp2)
[1] 0.02751103
> colRanges(tmp2)
[,1]
[1,] -2.636845
[2,] 3.164877
>
> 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] -2.3456765 -4.5587127 -6.7254725 5.7267167 -2.5733985 -4.6400208
[7] 0.2139178 -1.9209989 5.3457233 -2.1624785
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.5760240
[2,] -0.6865133
[3,] -0.2619150
[4,] 0.2839386
[5,] 0.8985615
>
> rowApply(tmp,sum)
[1] -0.2450358 -1.3371400 -2.3387040 -5.3401856 -7.2281639 1.9521686
[7] 2.4708670 4.6282694 -5.6568595 -0.5456166
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 4 4 8 6 8 3 9 6 2 5
[2,] 9 1 1 4 6 6 2 5 8 6
[3,] 10 5 7 1 4 1 6 1 6 1
[4,] 3 10 4 9 3 9 8 10 9 7
[5,] 5 7 10 10 10 2 1 3 1 2
[6,] 1 3 3 3 1 5 10 4 4 8
[7,] 6 2 9 5 5 7 7 9 7 9
[8,] 8 6 5 8 9 4 3 7 3 3
[9,] 7 9 2 7 2 10 4 8 10 10
[10,] 2 8 6 2 7 8 5 2 5 4
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.52723029 -1.44898610 3.50796930 -2.13626203 -3.27502427 -2.43895878
[7] 1.38632745 -0.49295915 -3.14713306 -2.64759340 3.65044295 -0.09119284
[13] -2.45237752 -0.61170946 -1.51968687 2.65037234 -0.22687893 -2.78344871
[19] 1.11798734 -0.13476616
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.95415231
[2,] 0.01214098
[3,] 0.06709695
[4,] 0.07385830
[5,] 1.32828637
>
> rowApply(tmp,sum)
[1] -1.862911 4.281204 2.539639 -9.468051 -6.056529
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 13 7 13 5 18
[2,] 11 15 2 8 10
[3,] 15 20 18 11 12
[4,] 18 6 1 7 7
[5,] 4 1 14 3 11
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.06709695 -0.06720515 0.5392525 0.71525758 -0.9827068 -0.72156973
[2,] 0.01214098 0.45017407 2.1934143 -0.02468139 -0.9538392 0.94972101
[3,] 0.07385830 -0.81466889 1.4182038 -1.13047581 0.1674193 -0.16781449
[4,] -0.95415231 -0.65890482 -0.4287798 -0.66469816 -1.2842087 -2.44670648
[5,] 1.32828637 -0.35838132 -0.2141216 -1.03166426 -0.2216890 -0.05258909
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.67121145 -0.4743644 -1.3260465 -1.3939930 1.824979878 0.2784220
[2,] 1.08135970 0.7902511 0.3139833 0.2156591 -0.080247471 -0.7671233
[3,] -0.04207913 -0.4590393 0.3266899 -0.1420237 0.005958301 -0.5331996
[4,] -1.20959914 -0.2889603 -1.9085945 0.4709238 1.648132312 0.2944207
[5,] 0.88543457 -0.0608463 -0.5531652 -1.7981597 0.251619931 0.6362873
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.57322472 -0.8314488 -1.4910624 -0.95156319 -0.1485079 -0.1663984
[2,] 0.08637142 0.2715466 -0.6162338 -0.91603721 0.1786208 0.2627864
[3,] -0.54462762 0.5229145 1.6639480 2.34202548 1.1582177 -0.4894982
[4,] -0.30568827 0.2397095 0.1815597 0.07188355 -0.2425390 -0.5913227
[5,] -2.26165777 -0.8144312 -1.2578985 2.10406370 -1.1726705 -1.7990159
[,19] [,20]
[1,] 0.008641351 2.0138689
[2,] 0.658784291 0.1745530
[3,] -0.334982599 -0.4811866
[4,] -0.887561784 -0.5029643
[5,] 1.673106085 -1.3390372
>
>
> 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 : 649 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 : 562 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.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 1.054609 0.09741702 -0.2186305 -1.290212 -1.200317 -0.488636 -0.4934969
col8 col9 col10 col11 col12 col13 col14
row1 -1.477299 0.7649728 2.332545 0.2799077 0.5320671 -0.4149227 -0.7292099
col15 col16 col17 col18 col19 col20
row1 -0.2556372 -2.26265 0.2229951 0.3824025 0.8206861 1.211435
> tmp[,"col10"]
col10
row1 2.33254531
row2 0.05396222
row3 -2.26061538
row4 -1.26985951
row5 -0.52514861
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 1.0546089 0.09741702 -0.2186305 -1.29021234 -1.200317 -0.4886360
row5 -0.1949466 0.80988400 -0.6042094 0.02976046 -1.536004 0.2659764
col7 col8 col9 col10 col11 col12
row1 -0.4934969 -1.4772985 0.7649728 2.3325453 0.27990765 0.5320671
row5 1.3922332 -0.8018462 1.3222437 -0.5251486 -0.03066754 -0.2520909
col13 col14 col15 col16 col17 col18
row1 -0.4149227 -0.7292099 -0.2556372 -2.2626501 0.2229951 0.3824025
row5 -0.4759210 -1.4513264 0.2956228 -0.2853913 0.4429220 -0.6051135
col19 col20
row1 0.8206861 1.211435
row5 -1.4056599 -1.032410
> tmp[,c("col6","col20")]
col6 col20
row1 -0.4886360 1.2114347
row2 -1.3016778 1.3541039
row3 1.7132764 0.4849289
row4 0.1650825 -0.3145358
row5 0.2659764 -1.0324098
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.4886360 1.211435
row5 0.2659764 -1.032410
>
>
>
>
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105)
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.00653 49.5154 51.5814 51.00206 50.24088 105.175 49.7116 51.51093
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.31107 48.93323 50.87227 51.50188 48.92572 50.91526 50.75808 50.99949
col17 col18 col19 col20
row1 51.10005 49.08878 50.60719 106.1506
> tmp[,"col10"]
col10
row1 48.93323
row2 30.05240
row3 28.99899
row4 29.69580
row5 49.91364
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.00653 49.5154 51.58140 51.00206 50.24088 105.1750 49.71160 51.51093
row5 49.78302 48.6911 49.21443 51.32500 49.91109 104.0082 51.61323 49.65978
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.31107 48.93323 50.87227 51.50188 48.92572 50.91526 50.75808 50.99949
row5 50.55204 49.91364 49.70731 48.67134 49.97538 50.40841 50.45416 49.25376
col17 col18 col19 col20
row1 51.10005 49.08878 50.60719 106.1506
row5 49.49242 50.69806 48.19314 104.7017
> tmp[,c("col6","col20")]
col6 col20
row1 105.17502 106.15063
row2 76.01154 74.29505
row3 75.68226 75.00608
row4 75.95292 76.36943
row5 104.00821 104.70167
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.1750 106.1506
row5 104.0082 104.7017
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.1750 106.1506
row5 104.0082 104.7017
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 1.91668912
[2,] -0.69459857
[3,] -0.08815315
[4,] 2.77711542
[5,] -0.94782364
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.008479204 0.682815820
[2,] 0.122710604 -0.007304982
[3,] 0.102051625 0.478216204
[4,] 0.708263347 0.998280898
[5,] -0.078399488 0.653013204
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 1.2778733 0.006945394
[2,] 1.3603452 1.313176777
[3,] 0.8843231 1.105552119
[4,] -0.3452866 0.348330362
[5,] 0.8764036 -0.518553080
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 1.277873
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 1.277873
[2,] 1.360345
>
>
>
> 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.0907870 -1.132083 1.2136765 0.4363638 -0.9908793 -0.04209731 1.715247
row1 0.7098851 1.062592 0.5552738 -2.1680695 0.1952540 0.63110150 -0.427127
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 -0.4194632 -0.9719470 1.3180261 0.3648224 0.3056696 -1.2981980 0.6076451
row1 1.3643949 -0.8510871 0.2182724 0.2288611 -2.0650125 0.3245706 -1.4202401
[,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.5014248 0.1325518 0.8640446 -0.1564443 0.7771382 1.559851
row1 0.7371498 0.4540196 1.1332974 -1.1274415 -0.2329675 -0.240873
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.2755461 0.2042765 -1.135708 0.006482296 -0.8453987 1.049379 -0.7120572
[,8] [,9] [,10]
row2 0.3712301 -0.6534044 0.6347579
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.07525234 -0.9387319 1.298865 0.0127238 -0.4750647 -0.04193888 -0.9461127
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.3644589 -0.4345136 0.2116676 0.2950039 -0.6605548 0.572286 0.5076841
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.3352885 0.57938 -0.1040174 -1.146354 0.2253303 -0.165424
>
>
> 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: 0x600000964660>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM9d491926f26f"
[2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM9d494bf6624f"
[3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM9d491cb0577f"
[4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM9d497d40618f"
[5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM9d49dc53387"
[6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM9d49db9eb21"
[7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM9d4928fbca91"
[8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM9d492ab00a9c"
[9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM9d49b889da9"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM9d493626c829"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM9d492c1f1785"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM9d492d413364"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM9d4913950172"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM9d491b91ed69"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM9d4997996a3"
>
>
> ### 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: 0x6000009403c0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6000009403c0>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x6000009403c0>
> rowMedians(tmp)
[1] 0.161968553 0.002453736 -0.481407089 -0.349953902 -0.278658053
[6] 0.157200325 -0.054465183 0.201129205 -0.058431117 -0.328329166
[11] 0.452830085 0.663451027 -0.538593828 -0.375100768 -0.124405154
[16] 0.131676427 0.152801180 0.112291769 -0.145585012 0.056571355
[21] -0.311665000 -0.573687323 -0.155020648 0.514376641 0.142211363
[26] 0.293461314 -0.265247958 -0.083244174 -0.277497168 0.324198177
[31] -0.216061702 -0.110144587 0.047181270 -0.003543548 -0.196104361
[36] 0.324122155 0.383711184 0.071169644 0.367648010 0.369217188
[41] -0.355676325 0.109604087 -0.098769745 0.452146859 -0.010119557
[46] 0.247557925 0.113803168 -0.079683523 0.416620817 0.430172515
[51] 0.015957868 0.444506185 -0.039670875 -0.482167341 -0.443258824
[56] -0.183750558 0.001928154 0.239345331 -0.213760830 0.049774835
[61] -0.106653068 0.627438650 0.031612678 0.391811690 0.524925015
[66] 0.112523792 0.045193885 -0.798464467 0.104860939 -0.393608553
[71] 0.201920522 -0.123380622 -0.218583983 0.311049373 0.104533364
[76] 0.005488662 -0.251313794 -0.159337293 0.272480796 0.342494180
[81] -0.033758287 0.257257876 -0.294324122 0.182338992 0.289111323
[86] -0.057039169 0.041907640 0.762379035 -0.555021057 -0.263202001
[91] -0.503622972 0.066774079 0.045255185 -0.352731726 -0.109996848
[96] 0.286081153 -0.100243250 -0.454829571 -0.050380443 0.298842417
[101] -0.165002101 -0.296849115 0.465200435 0.252001710 0.179372375
[106] 0.024255506 0.124579151 0.169674793 0.372336067 0.473230836
[111] -0.193019902 0.326232223 -0.087899303 0.460542139 0.031304475
[116] -0.331621932 -0.063018838 -0.013141613 0.141574462 -0.327754884
[121] -0.623169119 0.054752240 -0.250526150 -0.271421097 -0.005096886
[126] 0.154637772 -0.239861618 -0.280644055 0.169598900 -0.297838991
[131] -0.357956971 0.308981394 -0.032560199 -0.147168618 0.534789103
[136] -0.173346072 0.305169647 0.923784509 -0.318919622 -0.233563211
[141] -0.029200740 0.024790240 0.091890191 -0.337809557 0.506944488
[146] -0.174954222 0.259885229 0.056876976 0.567585092 0.023680932
[151] 0.183151884 -0.032071365 -0.017437065 -0.605016441 -0.131601039
[156] -0.094373325 0.030888418 0.340860069 -0.052305154 -0.243305814
[161] -0.222598016 -0.125737251 0.247508608 0.211703610 0.101304028
[166] 0.322541315 0.415612416 0.425733989 -0.224119745 -0.228156613
[171] -0.011221934 -0.161469958 0.460650931 0.293014594 -0.487300306
[176] 0.348375699 -0.444735437 0.075809372 0.057595498 0.198773371
[181] -0.082765827 0.507530233 0.267454423 -0.474667868 0.060199450
[186] -0.010499053 0.585555351 -0.112012624 0.065647820 -0.249011768
[191] 0.198705391 -0.081378138 0.398626533 -0.056721138 -1.078315617
[196] -0.055240675 0.204741118 0.061945097 0.649326217 -0.094014179
[201] 0.208650451 0.141740425 0.264817549 -0.009364011 0.275129029
[206] 0.300412354 -0.053418343 0.294037841 -0.691262732 -0.006292992
[211] -0.343718892 -0.114139795 -0.369835042 -0.061253594 0.103698375
[216] 0.105725809 0.142098827 -0.151829149 -0.510469905 -0.427741933
[221] 0.330072653 0.007259293 -0.564878078 -0.264300980 -0.057148501
[226] 0.133237565 -0.138507660 0.651192939 0.400211094 -0.118656988
>
> proc.time()
user system elapsed
2.224 9.477 16.334
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: 0x600002058540>
> .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: 0x600002058540>
> .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: 0x600002058540>
> .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: 0x600002058540>
> 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: 0x600002044000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002044000>
> .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: 0x600002044000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002044000>
> .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: 0x600002044000>
> 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: 0x600002044180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002044180>
> .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: 0x600002044180>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002044180>
> .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: 0x600002044180>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x600002044180>
> .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: 0x600002044180>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x600002044180>
> .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: 0x600002044180>
> 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: 0x6000020488a0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000020488a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000020488a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000020488a0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilea2bc1dca4c25" "BufferedMatrixFilea2bc3eb7ef76"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilea2bc1dca4c25" "BufferedMatrixFilea2bc3eb7ef76"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002048b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002048b40>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002048b40>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600002048b40>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600002048b40>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600002048b40>
> .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: 0x600002048d20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600002048d20>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600002048d20>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600002048d20>
> 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: 0x600002054240>
> .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: 0x600002054240>
> rm(P)
>
> proc.time()
user system elapsed
0.343 0.105 0.494
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.074 0.484