| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-11-24 12:06 -0500 (Mon, 24 Nov 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" | 4873 |
| merida1 | macOS 12.7.6 Monterey | x86_64 | 4.5.2 Patched (2025-11-05 r88990) -- "[Not] Part in a Rumble" | 4654 |
| kjohnson1 | macOS 13.7.5 Ventura | arm64 | 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble" | 4600 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4668 |
| 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-11-21 17:40:26 -0500 (Fri, 21 Nov 2025) |
| EndedAt: 2025-11-21 17:41:19 -0500 (Fri, 21 Nov 2025) |
| EllapsedTime: 53.5 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.351 0.114 0.579
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) limit (Mb) max used (Mb)
Ncells 480695 25.7 1056201 56.5 NA 634425 33.9
Vcells 890553 6.8 8388608 64.0 65536 2109045 16.1
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri Nov 21 17:40:51 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri Nov 21 17:40:51 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: 0x600003ea84e0>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri Nov 21 17:40:55 2025"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri Nov 21 17:40:57 2025"
>
> ColMode(tmp2)
<pointer: 0x600003ea84e0>
>
>
>
> ### 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,] 98.1045472 0.6211460 0.4982206 1.004464
[2,] -0.4704406 0.3685027 -0.7711473 0.818761
[3,] -1.0496435 -0.5535179 -2.2936955 2.252539
[4,] 0.5117312 -0.5040593 0.4170398 1.505416
> 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,] 98.1045472 0.6211460 0.4982206 1.004464
[2,] 0.4704406 0.3685027 0.7711473 0.818761
[3,] 1.0496435 0.5535179 2.2936955 2.252539
[4,] 0.5117312 0.5040593 0.4170398 1.505416
> 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,] 9.9047740 0.7881282 0.7058474 1.0022297
[2,] 0.6858867 0.6070442 0.8781499 0.9048541
[3,] 1.0245211 0.7439879 1.5144951 1.5008459
[4,] 0.7153539 0.7099714 0.6457862 1.2269541
>
> 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,] 222.15229 33.50243 32.55669 36.02676
[2,] 32.32931 31.43895 34.55265 34.86730
[3,] 36.29485 32.99340 42.43865 42.26100
[4,] 32.66527 32.60377 31.87490 38.77496
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600003ea8540>
> exp(tmp5)
<pointer: 0x600003ea8540>
> log(tmp5,2)
<pointer: 0x600003ea8540>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 462.3809
> Min(tmp5)
[1] 53.92521
> mean(tmp5)
[1] 72.72032
> Sum(tmp5)
[1] 14544.06
> Var(tmp5)
[1] 836.7242
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 92.09019 71.03671 72.35990 68.13484 71.56132 71.29209 69.21774 70.95230
[9] 69.42773 71.13037
> rowSums(tmp5)
[1] 1841.804 1420.734 1447.198 1362.697 1431.226 1425.842 1384.355 1419.046
[9] 1388.555 1422.607
> rowVars(tmp5)
[1] 7633.76991 61.36101 71.54545 60.07237 44.33283 53.19404
[7] 98.03172 81.50942 113.18551 92.55220
> rowSd(tmp5)
[1] 87.371448 7.833327 8.458454 7.750637 6.658290 7.293424 9.901097
[8] 9.028257 10.638868 9.620406
> rowMax(tmp5)
[1] 462.38088 91.16733 88.33048 80.70499 83.92683 85.22352 85.57928
[8] 93.37666 91.04278 84.90465
> rowMin(tmp5)
[1] 59.01545 54.11607 56.93427 53.92521 62.76067 59.19311 57.42046 55.77281
[9] 56.80231 56.79156
>
> colMeans(tmp5)
[1] 112.22443 74.14683 72.46651 76.27898 66.50049 71.34943 73.64350
[8] 65.78471 72.21466 70.80906 69.80891 72.25449 72.95512 70.13748
[15] 68.40252 71.71000 68.69207 66.77707 67.57146 70.67865
> colSums(tmp5)
[1] 1122.2443 741.4683 724.6651 762.7898 665.0049 713.4943 736.4350
[8] 657.8471 722.1466 708.0906 698.0891 722.5449 729.5512 701.3748
[15] 684.0252 717.1000 686.9207 667.7707 675.7146 706.7865
> colVars(tmp5)
[1] 15195.09007 128.94209 71.41165 75.73001 42.90100 54.73635
[7] 36.93027 49.77136 84.19657 40.06842 69.75811 74.93847
[13] 131.62398 60.25167 41.14661 52.33861 98.57660 34.63292
[19] 114.33008 58.99485
> colSd(tmp5)
[1] 123.268366 11.355267 8.450541 8.702299 6.549885 7.398402
[7] 6.077028 7.054882 9.175869 6.329962 8.352132 8.656701
[13] 11.472749 7.762195 6.414562 7.234543 9.928575 5.884974
[19] 10.692524 7.680810
> colMax(tmp5)
[1] 462.38088 93.37666 88.33048 87.96073 77.97178 79.64418 82.00390
[8] 77.02920 83.17910 78.86482 84.90465 86.83487 91.16733 85.57928
[15] 77.19194 83.39816 84.01474 77.03321 84.06888 83.02380
> colMin(tmp5)
[1] 62.28147 60.04785 61.90513 57.66977 59.01545 56.79156 62.10187 53.92521
[9] 55.77281 57.42046 60.61497 58.44511 56.98383 60.51286 59.30855 59.39421
[17] 56.38499 56.80231 54.11607 60.47756
>
>
> ### 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] 92.09019 71.03671 72.35990 68.13484 71.56132 71.29209 69.21774 70.95230
[9] 69.42773 NA
> rowSums(tmp5)
[1] 1841.804 1420.734 1447.198 1362.697 1431.226 1425.842 1384.355 1419.046
[9] 1388.555 NA
> rowVars(tmp5)
[1] 7633.76991 61.36101 71.54545 60.07237 44.33283 53.19404
[7] 98.03172 81.50942 113.18551 86.59863
> rowSd(tmp5)
[1] 87.371448 7.833327 8.458454 7.750637 6.658290 7.293424 9.901097
[8] 9.028257 10.638868 9.305839
> rowMax(tmp5)
[1] 462.38088 91.16733 88.33048 80.70499 83.92683 85.22352 85.57928
[8] 93.37666 91.04278 NA
> rowMin(tmp5)
[1] 59.01545 54.11607 56.93427 53.92521 62.76067 59.19311 57.42046 55.77281
[9] 56.80231 NA
>
> colMeans(tmp5)
[1] 112.22443 74.14683 72.46651 76.27898 66.50049 71.34943 73.64350
[8] 65.78471 72.21466 70.80906 NA 72.25449 72.95512 70.13748
[15] 68.40252 71.71000 68.69207 66.77707 67.57146 70.67865
> colSums(tmp5)
[1] 1122.2443 741.4683 724.6651 762.7898 665.0049 713.4943 736.4350
[8] 657.8471 722.1466 708.0906 NA 722.5449 729.5512 701.3748
[15] 684.0252 717.1000 686.9207 667.7707 675.7146 706.7865
> colVars(tmp5)
[1] 15195.09007 128.94209 71.41165 75.73001 42.90100 54.73635
[7] 36.93027 49.77136 84.19657 40.06842 NA 74.93847
[13] 131.62398 60.25167 41.14661 52.33861 98.57660 34.63292
[19] 114.33008 58.99485
> colSd(tmp5)
[1] 123.268366 11.355267 8.450541 8.702299 6.549885 7.398402
[7] 6.077028 7.054882 9.175869 6.329962 NA 8.656701
[13] 11.472749 7.762195 6.414562 7.234543 9.928575 5.884974
[19] 10.692524 7.680810
> colMax(tmp5)
[1] 462.38088 93.37666 88.33048 87.96073 77.97178 79.64418 82.00390
[8] 77.02920 83.17910 78.86482 NA 86.83487 91.16733 85.57928
[15] 77.19194 83.39816 84.01474 77.03321 84.06888 83.02380
> colMin(tmp5)
[1] 62.28147 60.04785 61.90513 57.66977 59.01545 56.79156 62.10187 53.92521
[9] 55.77281 57.42046 NA 58.44511 56.98383 60.51286 59.30855 59.39421
[17] 56.38499 56.80231 54.11607 60.47756
>
> Max(tmp5,na.rm=TRUE)
[1] 462.3809
> Min(tmp5,na.rm=TRUE)
[1] 53.92521
> mean(tmp5,na.rm=TRUE)
[1] 72.65909
> Sum(tmp5,na.rm=TRUE)
[1] 14459.16
> Var(tmp5,na.rm=TRUE)
[1] 840.1965
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 92.09019 71.03671 72.35990 68.13484 71.56132 71.29209 69.21774 70.95230
[9] 69.42773 70.40541
> rowSums(tmp5,na.rm=TRUE)
[1] 1841.804 1420.734 1447.198 1362.697 1431.226 1425.842 1384.355 1419.046
[9] 1388.555 1337.703
> rowVars(tmp5,na.rm=TRUE)
[1] 7633.76991 61.36101 71.54545 60.07237 44.33283 53.19404
[7] 98.03172 81.50942 113.18551 86.59863
> rowSd(tmp5,na.rm=TRUE)
[1] 87.371448 7.833327 8.458454 7.750637 6.658290 7.293424 9.901097
[8] 9.028257 10.638868 9.305839
> rowMax(tmp5,na.rm=TRUE)
[1] 462.38088 91.16733 88.33048 80.70499 83.92683 85.22352 85.57928
[8] 93.37666 91.04278 83.17910
> rowMin(tmp5,na.rm=TRUE)
[1] 59.01545 54.11607 56.93427 53.92521 62.76067 59.19311 57.42046 55.77281
[9] 56.80231 56.79156
>
> colMeans(tmp5,na.rm=TRUE)
[1] 112.22443 74.14683 72.46651 76.27898 66.50049 71.34943 73.64350
[8] 65.78471 72.21466 70.80906 68.13161 72.25449 72.95512 70.13748
[15] 68.40252 71.71000 68.69207 66.77707 67.57146 70.67865
> colSums(tmp5,na.rm=TRUE)
[1] 1122.2443 741.4683 724.6651 762.7898 665.0049 713.4943 736.4350
[8] 657.8471 722.1466 708.0906 613.1845 722.5449 729.5512 701.3748
[15] 684.0252 717.1000 686.9207 667.7707 675.7146 706.7865
> colVars(tmp5,na.rm=TRUE)
[1] 15195.09007 128.94209 71.41165 75.73001 42.90100 54.73635
[7] 36.93027 49.77136 84.19657 40.06842 46.82770 74.93847
[13] 131.62398 60.25167 41.14661 52.33861 98.57660 34.63292
[19] 114.33008 58.99485
> colSd(tmp5,na.rm=TRUE)
[1] 123.268366 11.355267 8.450541 8.702299 6.549885 7.398402
[7] 6.077028 7.054882 9.175869 6.329962 6.843077 8.656701
[13] 11.472749 7.762195 6.414562 7.234543 9.928575 5.884974
[19] 10.692524 7.680810
> colMax(tmp5,na.rm=TRUE)
[1] 462.38088 93.37666 88.33048 87.96073 77.97178 79.64418 82.00390
[8] 77.02920 83.17910 78.86482 79.25429 86.83487 91.16733 85.57928
[15] 77.19194 83.39816 84.01474 77.03321 84.06888 83.02380
> colMin(tmp5,na.rm=TRUE)
[1] 62.28147 60.04785 61.90513 57.66977 59.01545 56.79156 62.10187 53.92521
[9] 55.77281 57.42046 60.61497 58.44511 56.98383 60.51286 59.30855 59.39421
[17] 56.38499 56.80231 54.11607 60.47756
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 92.09019 71.03671 72.35990 68.13484 71.56132 71.29209 69.21774 70.95230
[9] 69.42773 NaN
> rowSums(tmp5,na.rm=TRUE)
[1] 1841.804 1420.734 1447.198 1362.697 1431.226 1425.842 1384.355 1419.046
[9] 1388.555 0.000
> rowVars(tmp5,na.rm=TRUE)
[1] 7633.76991 61.36101 71.54545 60.07237 44.33283 53.19404
[7] 98.03172 81.50942 113.18551 NA
> rowSd(tmp5,na.rm=TRUE)
[1] 87.371448 7.833327 8.458454 7.750637 6.658290 7.293424 9.901097
[8] 9.028257 10.638868 NA
> rowMax(tmp5,na.rm=TRUE)
[1] 462.38088 91.16733 88.33048 80.70499 83.92683 85.22352 85.57928
[8] 93.37666 91.04278 NA
> rowMin(tmp5,na.rm=TRUE)
[1] 59.01545 54.11607 56.93427 53.92521 62.76067 59.19311 57.42046 55.77281
[9] 56.80231 NA
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 115.72312 75.71339 73.63999 76.98105 67.25458 72.96697 72.71457
[8] 65.47479 70.99639 69.91398 NaN 72.10228 71.84223 71.20688
[15] 68.87466 72.69726 67.27659 66.38216 68.14185 69.90526
> colSums(tmp5,na.rm=TRUE)
[1] 1041.5081 681.4205 662.7599 692.8295 605.2912 656.7028 654.4311
[8] 589.2731 638.9675 629.2258 0.0000 648.9205 646.5800 640.8619
[15] 619.8720 654.2753 605.4894 597.4394 613.2766 629.1474
> colVars(tmp5,na.rm=TRUE)
[1] 16956.76673 117.45134 64.84607 79.65106 41.86636 32.14346
[7] 31.83875 54.91221 78.02406 36.06376 NA 84.04513
[13] 134.14336 54.91741 43.78214 47.91594 88.35865 37.20753
[19] 124.96128 59.64030
> colSd(tmp5,na.rm=TRUE)
[1] 130.218151 10.837497 8.052706 8.924744 6.470422 5.669520
[7] 5.642584 7.410277 8.833123 6.005311 NA 9.167613
[13] 11.582027 7.410628 6.616807 6.922134 9.399928 6.099797
[19] 11.178608 7.722713
> colMax(tmp5,na.rm=TRUE)
[1] 462.38088 93.37666 88.33048 87.96073 77.97178 79.64418 80.44991
[8] 77.02920 82.95163 77.77755 -Inf 86.83487 91.16733 85.57928
[15] 77.19194 83.39816 84.01474 77.03321 84.06888 83.02380
> colMin(tmp5,na.rm=TRUE)
[1] 62.28147 65.43605 65.82055 57.66977 59.01545 64.00627 62.10187 53.92521
[9] 55.77281 57.42046 Inf 58.44511 56.98383 63.56073 59.30855 59.39421
[17] 56.38499 56.80231 54.11607 60.47756
>
>
>
>
> 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] 191.0158 227.2362 140.4740 242.8869 297.8073 179.7761 298.4710 214.9900
[9] 297.2039 218.0639
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 191.0158 227.2362 140.4740 242.8869 297.8073 179.7761 298.4710 214.9900
[9] 297.2039 218.0639
>
>
>
> 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 0.000000e+00 -1.065814e-13 5.684342e-14 0.000000e+00
[6] 1.136868e-13 -7.105427e-14 -2.842171e-14 -5.684342e-14 0.000000e+00
[11] -7.105427e-14 2.842171e-13 -5.684342e-14 -2.842171e-14 -1.705303e-13
[16] 5.684342e-14 -5.684342e-14 -5.684342e-14 1.136868e-13 0.000000e+00
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
1 1
8 2
5 6
1 6
9 2
4 4
2 1
3 10
2 10
5 7
10 10
4 11
3 7
1 20
3 2
4 16
8 9
6 1
6 12
9 5
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 2.837035
> Min(tmp)
[1] -2.09228
> mean(tmp)
[1] -0.07884321
> Sum(tmp)
[1] -7.884321
> Var(tmp)
[1] 1.012215
>
> rowMeans(tmp)
[1] -0.07884321
> rowSums(tmp)
[1] -7.884321
> rowVars(tmp)
[1] 1.012215
> rowSd(tmp)
[1] 1.006089
> rowMax(tmp)
[1] 2.837035
> rowMin(tmp)
[1] -2.09228
>
> colMeans(tmp)
[1] -0.61760580 -1.70650902 0.78059576 -0.95027372 -0.00071003 -0.65806713
[7] 1.76160901 0.59100392 0.69236300 0.38429915 2.83703505 -1.74935586
[13] -1.08095441 1.02787836 1.33677373 0.48226032 -0.73371106 -0.85528880
[19] 0.39252149 -0.10637182 -0.78202695 -0.08985395 0.48906121 0.48344069
[25] 0.81526058 0.98445100 0.86215132 -0.56431553 0.49406673 1.41893181
[31] -0.11043841 -0.13778222 -1.86373384 -0.87970206 -0.30142053 0.83511660
[37] -0.90019433 -0.99711551 -0.70778896 0.95631196 0.96557282 -0.45469365
[43] -0.82747665 1.09218950 -0.88316090 -0.80651024 -1.69476702 0.36593757
[49] 1.30718309 -0.75631227 -0.19143731 0.63735034 -0.07239129 -1.53341062
[55] -1.65958793 -0.27898843 0.49989091 0.32981796 1.69723378 0.26168641
[61] -0.51327918 -1.70284276 -0.48155015 -1.63292335 0.74195980 -1.32880459
[67] -0.92323267 1.01868085 0.28706151 1.84839927 -0.10347995 0.01600751
[73] 0.10759507 1.06496033 1.60539840 0.47472068 -1.30067906 0.24584512
[79] -0.27365948 -1.73761513 0.20670093 0.77870856 0.62492833 -0.52603213
[85] 0.05617810 1.22379141 -0.68000496 -0.66919716 -0.08968798 -1.72820160
[91] 1.36531787 -1.44380217 -1.59615437 -0.39657789 -0.71521350 -0.41795095
[97] 0.66895655 0.47741965 -2.09228050 -0.17381911
> colSums(tmp)
[1] -0.61760580 -1.70650902 0.78059576 -0.95027372 -0.00071003 -0.65806713
[7] 1.76160901 0.59100392 0.69236300 0.38429915 2.83703505 -1.74935586
[13] -1.08095441 1.02787836 1.33677373 0.48226032 -0.73371106 -0.85528880
[19] 0.39252149 -0.10637182 -0.78202695 -0.08985395 0.48906121 0.48344069
[25] 0.81526058 0.98445100 0.86215132 -0.56431553 0.49406673 1.41893181
[31] -0.11043841 -0.13778222 -1.86373384 -0.87970206 -0.30142053 0.83511660
[37] -0.90019433 -0.99711551 -0.70778896 0.95631196 0.96557282 -0.45469365
[43] -0.82747665 1.09218950 -0.88316090 -0.80651024 -1.69476702 0.36593757
[49] 1.30718309 -0.75631227 -0.19143731 0.63735034 -0.07239129 -1.53341062
[55] -1.65958793 -0.27898843 0.49989091 0.32981796 1.69723378 0.26168641
[61] -0.51327918 -1.70284276 -0.48155015 -1.63292335 0.74195980 -1.32880459
[67] -0.92323267 1.01868085 0.28706151 1.84839927 -0.10347995 0.01600751
[73] 0.10759507 1.06496033 1.60539840 0.47472068 -1.30067906 0.24584512
[79] -0.27365948 -1.73761513 0.20670093 0.77870856 0.62492833 -0.52603213
[85] 0.05617810 1.22379141 -0.68000496 -0.66919716 -0.08968798 -1.72820160
[91] 1.36531787 -1.44380217 -1.59615437 -0.39657789 -0.71521350 -0.41795095
[97] 0.66895655 0.47741965 -2.09228050 -0.17381911
> 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.61760580 -1.70650902 0.78059576 -0.95027372 -0.00071003 -0.65806713
[7] 1.76160901 0.59100392 0.69236300 0.38429915 2.83703505 -1.74935586
[13] -1.08095441 1.02787836 1.33677373 0.48226032 -0.73371106 -0.85528880
[19] 0.39252149 -0.10637182 -0.78202695 -0.08985395 0.48906121 0.48344069
[25] 0.81526058 0.98445100 0.86215132 -0.56431553 0.49406673 1.41893181
[31] -0.11043841 -0.13778222 -1.86373384 -0.87970206 -0.30142053 0.83511660
[37] -0.90019433 -0.99711551 -0.70778896 0.95631196 0.96557282 -0.45469365
[43] -0.82747665 1.09218950 -0.88316090 -0.80651024 -1.69476702 0.36593757
[49] 1.30718309 -0.75631227 -0.19143731 0.63735034 -0.07239129 -1.53341062
[55] -1.65958793 -0.27898843 0.49989091 0.32981796 1.69723378 0.26168641
[61] -0.51327918 -1.70284276 -0.48155015 -1.63292335 0.74195980 -1.32880459
[67] -0.92323267 1.01868085 0.28706151 1.84839927 -0.10347995 0.01600751
[73] 0.10759507 1.06496033 1.60539840 0.47472068 -1.30067906 0.24584512
[79] -0.27365948 -1.73761513 0.20670093 0.77870856 0.62492833 -0.52603213
[85] 0.05617810 1.22379141 -0.68000496 -0.66919716 -0.08968798 -1.72820160
[91] 1.36531787 -1.44380217 -1.59615437 -0.39657789 -0.71521350 -0.41795095
[97] 0.66895655 0.47741965 -2.09228050 -0.17381911
> colMin(tmp)
[1] -0.61760580 -1.70650902 0.78059576 -0.95027372 -0.00071003 -0.65806713
[7] 1.76160901 0.59100392 0.69236300 0.38429915 2.83703505 -1.74935586
[13] -1.08095441 1.02787836 1.33677373 0.48226032 -0.73371106 -0.85528880
[19] 0.39252149 -0.10637182 -0.78202695 -0.08985395 0.48906121 0.48344069
[25] 0.81526058 0.98445100 0.86215132 -0.56431553 0.49406673 1.41893181
[31] -0.11043841 -0.13778222 -1.86373384 -0.87970206 -0.30142053 0.83511660
[37] -0.90019433 -0.99711551 -0.70778896 0.95631196 0.96557282 -0.45469365
[43] -0.82747665 1.09218950 -0.88316090 -0.80651024 -1.69476702 0.36593757
[49] 1.30718309 -0.75631227 -0.19143731 0.63735034 -0.07239129 -1.53341062
[55] -1.65958793 -0.27898843 0.49989091 0.32981796 1.69723378 0.26168641
[61] -0.51327918 -1.70284276 -0.48155015 -1.63292335 0.74195980 -1.32880459
[67] -0.92323267 1.01868085 0.28706151 1.84839927 -0.10347995 0.01600751
[73] 0.10759507 1.06496033 1.60539840 0.47472068 -1.30067906 0.24584512
[79] -0.27365948 -1.73761513 0.20670093 0.77870856 0.62492833 -0.52603213
[85] 0.05617810 1.22379141 -0.68000496 -0.66919716 -0.08968798 -1.72820160
[91] 1.36531787 -1.44380217 -1.59615437 -0.39657789 -0.71521350 -0.41795095
[97] 0.66895655 0.47741965 -2.09228050 -0.17381911
> colMedians(tmp)
[1] -0.61760580 -1.70650902 0.78059576 -0.95027372 -0.00071003 -0.65806713
[7] 1.76160901 0.59100392 0.69236300 0.38429915 2.83703505 -1.74935586
[13] -1.08095441 1.02787836 1.33677373 0.48226032 -0.73371106 -0.85528880
[19] 0.39252149 -0.10637182 -0.78202695 -0.08985395 0.48906121 0.48344069
[25] 0.81526058 0.98445100 0.86215132 -0.56431553 0.49406673 1.41893181
[31] -0.11043841 -0.13778222 -1.86373384 -0.87970206 -0.30142053 0.83511660
[37] -0.90019433 -0.99711551 -0.70778896 0.95631196 0.96557282 -0.45469365
[43] -0.82747665 1.09218950 -0.88316090 -0.80651024 -1.69476702 0.36593757
[49] 1.30718309 -0.75631227 -0.19143731 0.63735034 -0.07239129 -1.53341062
[55] -1.65958793 -0.27898843 0.49989091 0.32981796 1.69723378 0.26168641
[61] -0.51327918 -1.70284276 -0.48155015 -1.63292335 0.74195980 -1.32880459
[67] -0.92323267 1.01868085 0.28706151 1.84839927 -0.10347995 0.01600751
[73] 0.10759507 1.06496033 1.60539840 0.47472068 -1.30067906 0.24584512
[79] -0.27365948 -1.73761513 0.20670093 0.77870856 0.62492833 -0.52603213
[85] 0.05617810 1.22379141 -0.68000496 -0.66919716 -0.08968798 -1.72820160
[91] 1.36531787 -1.44380217 -1.59615437 -0.39657789 -0.71521350 -0.41795095
[97] 0.66895655 0.47741965 -2.09228050 -0.17381911
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.6176058 -1.706509 0.7805958 -0.9502737 -0.00071003 -0.6580671 1.761609
[2,] -0.6176058 -1.706509 0.7805958 -0.9502737 -0.00071003 -0.6580671 1.761609
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.5910039 0.692363 0.3842992 2.837035 -1.749356 -1.080954 1.027878
[2,] 0.5910039 0.692363 0.3842992 2.837035 -1.749356 -1.080954 1.027878
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 1.336774 0.4822603 -0.7337111 -0.8552888 0.3925215 -0.1063718 -0.7820269
[2,] 1.336774 0.4822603 -0.7337111 -0.8552888 0.3925215 -0.1063718 -0.7820269
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.08985395 0.4890612 0.4834407 0.8152606 0.984451 0.8621513 -0.5643155
[2,] -0.08985395 0.4890612 0.4834407 0.8152606 0.984451 0.8621513 -0.5643155
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.4940667 1.418932 -0.1104384 -0.1377822 -1.863734 -0.8797021 -0.3014205
[2,] 0.4940667 1.418932 -0.1104384 -0.1377822 -1.863734 -0.8797021 -0.3014205
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.8351166 -0.9001943 -0.9971155 -0.707789 0.956312 0.9655728 -0.4546937
[2,] 0.8351166 -0.9001943 -0.9971155 -0.707789 0.956312 0.9655728 -0.4546937
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.8274767 1.09219 -0.8831609 -0.8065102 -1.694767 0.3659376 1.307183
[2,] -0.8274767 1.09219 -0.8831609 -0.8065102 -1.694767 0.3659376 1.307183
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.7563123 -0.1914373 0.6373503 -0.07239129 -1.533411 -1.659588 -0.2789884
[2,] -0.7563123 -0.1914373 0.6373503 -0.07239129 -1.533411 -1.659588 -0.2789884
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.4998909 0.329818 1.697234 0.2616864 -0.5132792 -1.702843 -0.4815502
[2,] 0.4998909 0.329818 1.697234 0.2616864 -0.5132792 -1.702843 -0.4815502
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -1.632923 0.7419598 -1.328805 -0.9232327 1.018681 0.2870615 1.848399
[2,] -1.632923 0.7419598 -1.328805 -0.9232327 1.018681 0.2870615 1.848399
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.1034799 0.01600751 0.1075951 1.06496 1.605398 0.4747207 -1.300679
[2,] -0.1034799 0.01600751 0.1075951 1.06496 1.605398 0.4747207 -1.300679
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.2458451 -0.2736595 -1.737615 0.2067009 0.7787086 0.6249283 -0.5260321
[2,] 0.2458451 -0.2736595 -1.737615 0.2067009 0.7787086 0.6249283 -0.5260321
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 0.0561781 1.223791 -0.680005 -0.6691972 -0.08968798 -1.728202 1.365318
[2,] 0.0561781 1.223791 -0.680005 -0.6691972 -0.08968798 -1.728202 1.365318
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -1.443802 -1.596154 -0.3965779 -0.7152135 -0.4179509 0.6689565 0.4774197
[2,] -1.443802 -1.596154 -0.3965779 -0.7152135 -0.4179509 0.6689565 0.4774197
[,99] [,100]
[1,] -2.09228 -0.1738191
[2,] -2.09228 -0.1738191
>
>
> Max(tmp2)
[1] 2.475318
> Min(tmp2)
[1] -2.975466
> mean(tmp2)
[1] -0.2061268
> Sum(tmp2)
[1] -20.61268
> Var(tmp2)
[1] 1.119148
>
> rowMeans(tmp2)
[1] -0.04073963 -1.82931604 -0.28088110 0.09666654 -1.94362618 0.16300912
[7] -0.62798591 0.47304874 -0.80786216 0.07553734 -0.70252608 -1.59128054
[13] -0.83714171 -0.19267764 0.24601638 0.02594894 0.37017818 -1.57593998
[19] 0.05085846 -0.22057090 2.00784661 1.04029460 -0.50440371 0.30834843
[25] 1.83216553 0.38310395 -0.73126519 0.22704117 -1.36076056 -1.03035843
[31] -0.23665140 -0.02829706 0.39754538 -2.83958248 -0.44547892 -2.03714051
[37] 1.23127104 -0.35996634 -1.05135076 1.42234838 -2.08433865 -0.69575591
[43] 1.82717991 -0.64888455 -2.25630608 -0.99591934 -1.59511526 0.26348522
[49] 1.56590071 -0.03520105 -0.54348337 -0.07176655 0.26742672 -0.27420418
[55] -0.69360607 0.84581511 0.24713759 -0.60828572 0.30545206 0.21975267
[61] -0.26168055 2.13056919 -0.24125692 -1.14360485 -1.66279694 -1.60404382
[67] -0.08190262 0.04781577 0.07747267 1.42542289 -1.17155429 1.30856096
[73] -2.97546648 -0.29906128 0.52814955 0.48090857 1.03562156 -0.68812045
[79] 0.78083364 -0.22152141 -1.13633301 -0.67925105 0.41366485 -1.46848829
[85] -0.45992299 -0.36806403 0.84644187 0.75808907 2.47531785 0.06435334
[91] -0.32188542 0.14326909 -1.57620359 0.74471954 -0.21966813 0.16678819
[97] -1.22615079 0.91234120 -1.60215624 0.34140470
> rowSums(tmp2)
[1] -0.04073963 -1.82931604 -0.28088110 0.09666654 -1.94362618 0.16300912
[7] -0.62798591 0.47304874 -0.80786216 0.07553734 -0.70252608 -1.59128054
[13] -0.83714171 -0.19267764 0.24601638 0.02594894 0.37017818 -1.57593998
[19] 0.05085846 -0.22057090 2.00784661 1.04029460 -0.50440371 0.30834843
[25] 1.83216553 0.38310395 -0.73126519 0.22704117 -1.36076056 -1.03035843
[31] -0.23665140 -0.02829706 0.39754538 -2.83958248 -0.44547892 -2.03714051
[37] 1.23127104 -0.35996634 -1.05135076 1.42234838 -2.08433865 -0.69575591
[43] 1.82717991 -0.64888455 -2.25630608 -0.99591934 -1.59511526 0.26348522
[49] 1.56590071 -0.03520105 -0.54348337 -0.07176655 0.26742672 -0.27420418
[55] -0.69360607 0.84581511 0.24713759 -0.60828572 0.30545206 0.21975267
[61] -0.26168055 2.13056919 -0.24125692 -1.14360485 -1.66279694 -1.60404382
[67] -0.08190262 0.04781577 0.07747267 1.42542289 -1.17155429 1.30856096
[73] -2.97546648 -0.29906128 0.52814955 0.48090857 1.03562156 -0.68812045
[79] 0.78083364 -0.22152141 -1.13633301 -0.67925105 0.41366485 -1.46848829
[85] -0.45992299 -0.36806403 0.84644187 0.75808907 2.47531785 0.06435334
[91] -0.32188542 0.14326909 -1.57620359 0.74471954 -0.21966813 0.16678819
[97] -1.22615079 0.91234120 -1.60215624 0.34140470
> 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.04073963 -1.82931604 -0.28088110 0.09666654 -1.94362618 0.16300912
[7] -0.62798591 0.47304874 -0.80786216 0.07553734 -0.70252608 -1.59128054
[13] -0.83714171 -0.19267764 0.24601638 0.02594894 0.37017818 -1.57593998
[19] 0.05085846 -0.22057090 2.00784661 1.04029460 -0.50440371 0.30834843
[25] 1.83216553 0.38310395 -0.73126519 0.22704117 -1.36076056 -1.03035843
[31] -0.23665140 -0.02829706 0.39754538 -2.83958248 -0.44547892 -2.03714051
[37] 1.23127104 -0.35996634 -1.05135076 1.42234838 -2.08433865 -0.69575591
[43] 1.82717991 -0.64888455 -2.25630608 -0.99591934 -1.59511526 0.26348522
[49] 1.56590071 -0.03520105 -0.54348337 -0.07176655 0.26742672 -0.27420418
[55] -0.69360607 0.84581511 0.24713759 -0.60828572 0.30545206 0.21975267
[61] -0.26168055 2.13056919 -0.24125692 -1.14360485 -1.66279694 -1.60404382
[67] -0.08190262 0.04781577 0.07747267 1.42542289 -1.17155429 1.30856096
[73] -2.97546648 -0.29906128 0.52814955 0.48090857 1.03562156 -0.68812045
[79] 0.78083364 -0.22152141 -1.13633301 -0.67925105 0.41366485 -1.46848829
[85] -0.45992299 -0.36806403 0.84644187 0.75808907 2.47531785 0.06435334
[91] -0.32188542 0.14326909 -1.57620359 0.74471954 -0.21966813 0.16678819
[97] -1.22615079 0.91234120 -1.60215624 0.34140470
> rowMin(tmp2)
[1] -0.04073963 -1.82931604 -0.28088110 0.09666654 -1.94362618 0.16300912
[7] -0.62798591 0.47304874 -0.80786216 0.07553734 -0.70252608 -1.59128054
[13] -0.83714171 -0.19267764 0.24601638 0.02594894 0.37017818 -1.57593998
[19] 0.05085846 -0.22057090 2.00784661 1.04029460 -0.50440371 0.30834843
[25] 1.83216553 0.38310395 -0.73126519 0.22704117 -1.36076056 -1.03035843
[31] -0.23665140 -0.02829706 0.39754538 -2.83958248 -0.44547892 -2.03714051
[37] 1.23127104 -0.35996634 -1.05135076 1.42234838 -2.08433865 -0.69575591
[43] 1.82717991 -0.64888455 -2.25630608 -0.99591934 -1.59511526 0.26348522
[49] 1.56590071 -0.03520105 -0.54348337 -0.07176655 0.26742672 -0.27420418
[55] -0.69360607 0.84581511 0.24713759 -0.60828572 0.30545206 0.21975267
[61] -0.26168055 2.13056919 -0.24125692 -1.14360485 -1.66279694 -1.60404382
[67] -0.08190262 0.04781577 0.07747267 1.42542289 -1.17155429 1.30856096
[73] -2.97546648 -0.29906128 0.52814955 0.48090857 1.03562156 -0.68812045
[79] 0.78083364 -0.22152141 -1.13633301 -0.67925105 0.41366485 -1.46848829
[85] -0.45992299 -0.36806403 0.84644187 0.75808907 2.47531785 0.06435334
[91] -0.32188542 0.14326909 -1.57620359 0.74471954 -0.21966813 0.16678819
[97] -1.22615079 0.91234120 -1.60215624 0.34140470
>
> colMeans(tmp2)
[1] -0.2061268
> colSums(tmp2)
[1] -20.61268
> colVars(tmp2)
[1] 1.119148
> colSd(tmp2)
[1] 1.057898
> colMax(tmp2)
[1] 2.475318
> colMin(tmp2)
[1] -2.975466
> colMedians(tmp2)
[1] -0.2061729
> colRanges(tmp2)
[,1]
[1,] -2.975466
[2,] 2.475318
>
> 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.5858135 -4.3720462 -0.5323879 -5.9295876 2.0062492 -3.3662816
[7] 2.6907307 -5.3155290 0.5348745 2.8841378
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.30584558
[2,] -0.77751740
[3,] 0.03499061
[4,] 0.76737702
[5,] 1.66199806
>
> rowApply(tmp,sum)
[1] -5.6366071 -3.9835100 -2.7778914 4.9186187 2.0747866 0.3830490
[7] 0.9805837 2.4472284 -3.3856738 -5.8346108
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 6 3 9 8 3 9 7 3 2 10
[2,] 2 2 2 9 7 3 5 5 6 2
[3,] 9 4 8 3 2 4 3 9 8 7
[4,] 4 6 3 7 1 5 4 4 5 1
[5,] 10 5 5 10 5 10 6 7 1 8
[6,] 8 1 10 1 8 2 1 6 3 9
[7,] 3 8 4 5 10 7 10 1 10 6
[8,] 1 7 1 4 4 6 2 8 7 3
[9,] 7 10 6 6 9 1 8 2 4 5
[10,] 5 9 7 2 6 8 9 10 9 4
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 1.2898092 -5.8232104 1.9258707 2.5538968 -3.0290133 2.0685195
[7] -1.1877869 3.7002544 -0.5352673 -2.8133941 -2.2917708 0.3880181
[13] -0.3611420 1.7067168 0.3585291 -0.6001062 1.9137233 3.7088612
[19] 1.2810110 0.2837607
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.4858686
[2,] -0.4581567
[3,] 0.1813771
[4,] 0.9826421
[5,] 1.0698153
>
> rowApply(tmp,sum)
[1] -5.177142 -7.744279 4.788364 2.626120 10.044216
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 10 17 11 15 3
[2,] 8 1 4 3 1
[3,] 15 14 18 12 7
[4,] 11 16 10 11 15
[5,] 13 2 5 5 10
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.4858686 -0.5727453 0.1145491 -0.3023461 -0.1361500 0.26025726
[2,] 1.0698153 -2.2980710 0.3784218 1.0429056 -2.0636448 1.24364330
[3,] 0.1813771 -0.6547919 1.0599832 0.1324900 -0.5184509 0.30062753
[4,] 0.9826421 -1.4485626 0.5024005 0.4576739 -0.6532923 0.18034329
[5,] -0.4581567 -0.8490396 -0.1294839 1.2231734 0.3425249 0.08364815
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.7583733 1.3546997 -0.7573065 -0.1519110 -0.6847191 -0.9691487
[2,] -1.2041930 1.1064387 -0.9944761 -1.1205056 -0.7580643 0.3908593
[3,] -1.1048538 2.1284034 -0.9555789 -0.2601283 -0.9529774 0.6349400
[4,] -0.3613889 -0.6651690 1.4636287 -0.6511167 -1.5058091 -0.2257545
[5,] 2.2410221 -0.2241185 0.7084657 -0.6297326 1.6097990 0.5571220
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -2.1286237 0.17502570 0.1082112 -0.5184377 -0.90655356 1.3811050
[2,] -0.8194065 -1.19354915 -0.2110553 -0.6875371 1.41643010 -0.9209381
[3,] 0.3024311 -0.05080349 0.6782933 0.0796689 -0.03250706 2.3804159
[4,] 1.0093718 1.19973039 -1.5784775 0.8978837 1.21044322 1.0353110
[5,] 1.2750853 1.57631335 1.3615574 -0.3716840 0.22591057 -0.1670325
[,19] [,20]
[1,] 0.4656002 -0.6644062
[2,] -1.1314610 -0.9898912
[3,] 0.6655618 0.7742640
[4,] 0.5915031 0.1847592
[5,] 0.6898069 0.9790350
>
>
> 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.9314185 -0.7177096 -0.6104408 1.516826 0.8777003 -0.008986282 0.2291018
col8 col9 col10 col11 col12 col13 col14
row1 -0.3430173 -0.7812415 -1.041353 0.4931332 0.3385175 -1.051012 0.6110322
col15 col16 col17 col18 col19 col20
row1 0.7685306 -2.201658 -1.613754 0.6983712 0.08089463 -1.411926
> tmp[,"col10"]
col10
row1 -1.04135335
row2 -0.39241763
row3 -0.03495041
row4 -1.06609095
row5 -0.82813363
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -0.9314185 -0.7177096 -0.6104408 1.5168255 0.8777003 -0.008986282
row5 -0.3973871 -0.4322445 -0.8999481 -0.2235451 1.1606391 0.726217222
col7 col8 col9 col10 col11 col12 col13
row1 0.2291018 -0.3430173 -0.7812415 -1.0413533 0.4931332 0.3385175 -1.051012
row5 -0.7068434 1.1095103 1.1696881 -0.8281336 0.7464564 -0.9635573 -1.379415
col14 col15 col16 col17 col18 col19
row1 0.6110322 0.7685306 -2.201658 -1.6137538 0.6983712 0.08089463
row5 1.8651297 -0.5768941 1.030789 -0.2921466 -0.2644567 -0.39429048
col20
row1 -1.4119258
row5 -0.5764756
> tmp[,c("col6","col20")]
col6 col20
row1 -0.008986282 -1.41192576
row2 -1.812739535 -1.73482286
row3 -0.947967388 0.09498912
row4 0.591094068 0.46086838
row5 0.726217222 -0.57647560
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.008986282 -1.4119258
row5 0.726217222 -0.5764756
>
>
>
>
> 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.95179 50.39528 50.35196 49.93883 52.22954 104.0309 49.78623 51.15565
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.32783 49.88515 50.88282 50.14667 49.52049 51.13282 50.05651 49.45521
col17 col18 col19 col20
row1 51.20367 50.40519 48.3687 105.3413
> tmp[,"col10"]
col10
row1 49.88515
row2 29.74616
row3 30.49136
row4 30.13491
row5 50.66649
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.95179 50.39528 50.35196 49.93883 52.22954 104.0309 49.78623 51.15565
row5 51.17374 50.87211 49.54092 49.86526 50.03237 104.3585 50.01270 51.75349
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.32783 49.88515 50.88282 50.14667 49.52049 51.13282 50.05651 49.45521
row5 49.18882 50.66649 50.06257 50.60804 50.88075 48.51965 51.02335 50.19508
col17 col18 col19 col20
row1 51.20367 50.40519 48.36870 105.3413
row5 51.44772 49.92316 49.30509 107.1775
> tmp[,c("col6","col20")]
col6 col20
row1 104.03094 105.34131
row2 73.83442 74.78600
row3 75.03530 74.74238
row4 76.04328 75.48272
row5 104.35849 107.17747
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.0309 105.3413
row5 104.3585 107.1775
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.0309 105.3413
row5 104.3585 107.1775
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.1151508
[2,] -0.6314597
[3,] 0.2526373
[4,] -0.5529544
[5,] -0.4793269
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.3387629 0.02851707
[2,] -0.2861210 -1.01627342
[3,] -2.3113224 -0.90503420
[4,] -0.5232265 0.47991042
[5,] 0.2217834 -0.59070421
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.06306232 1.0040323
[2,] -0.56987363 1.9898931
[3,] -0.21803649 1.2204428
[4,] 0.17279919 0.7590829
[5,] 0.01929180 -0.3211374
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.06306232
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.06306232
[2,] -0.56987363
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row3 0.5059008 -0.86741801 0.6882055 -0.9175036 0.5430539 -0.4820186
row1 -1.9697638 -0.02410092 0.5430422 0.5401830 0.9146654 -0.1353987
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row3 0.3607508 0.1161439 1.1915968 -2.262360 2.1860857 -1.5995574 0.2495155
row1 -0.6697413 -0.4150339 0.6643605 -1.747967 0.6040917 -0.8868631 0.7693422
[,14] [,15] [,16] [,17] [,18] [,19]
row3 -0.4322795 -0.2273578 0.9788905 -1.38933982 0.1591089 -1.9813751
row1 -1.6390075 -0.6394494 2.4409436 -0.08965853 -2.1330766 0.5519241
[,20]
row3 -1.299090
row1 -0.259507
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.006536641 0.8802181 1.674418 1.087625 -0.6166177 1.043921 -0.9468628
[,8] [,9] [,10]
row2 -2.605268 0.7098036 -0.1942187
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.5860703 1.14243 0.7022663 1.727639 -1.510455 -0.3459488 -0.05545818
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 1.04852 0.2280443 0.4124851 -0.5362015 -0.2472119 0.7147818 -1.606148
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.1946518 -1.122652 1.816248 0.05758545 1.11775 -0.3812857
>
>
> 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: 0x600003ea45a0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc64d2904c812"
[2] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc64d78eb2ac7"
[3] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc64d1745acd6"
[4] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc64d5f562189"
[5] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc64dfb3da45"
[6] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc64d68bef010"
[7] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc64d4f82e029"
[8] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc64d194acc87"
[9] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc64d7db9c009"
[10] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc64d2deecf5b"
[11] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc64d196f76ec"
[12] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc64d64e88cff"
[13] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc64d5f80ed1a"
[14] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc64d94e76f2"
[15] "/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BMc64d7e630ea3"
>
>
> ### 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: 0x600003eb8540>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600003eb8540>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x600003eb8540>
> rowMedians(tmp)
[1] 0.2778197828 -0.5397095176 0.0882466672 -0.3412410203 -0.5024360230
[6] -0.7387892367 -0.2267014249 0.0417854232 -0.1489526854 -0.5037883083
[11] 0.2761849755 -0.1013899834 -0.3654002008 0.3100237838 -0.1372184464
[16] -0.4976393159 -0.0146726589 -0.4004798899 -0.0827698472 -0.6764439657
[21] -0.1437709525 -0.6232410736 -0.3900972624 0.5645408872 0.1756523254
[26] 0.3171833792 0.0616260862 0.2406989062 -0.2993395947 0.7560225241
[31] -0.0111155756 0.2985201380 0.0583563236 -0.0353765882 0.1567382767
[36] -0.2053645591 0.3823842642 0.3707763314 0.1124056479 -0.2000086310
[41] 0.4260213449 -0.4052035953 0.0690336623 0.5170844762 -0.2525568012
[46] -0.5433559301 0.3988394977 -0.1039910088 0.0417723214 -0.1521481180
[51] 0.2397404386 0.2172899892 -0.2461324055 -0.0417530944 0.4639767862
[56] -0.0656543726 -0.3782157829 -0.0151919232 0.4368127572 -0.5116058241
[61] -0.3182345274 0.0453836480 -0.2846051409 0.0539099842 0.0071624714
[66] 0.6858222316 -0.1820405351 -0.1858603206 -0.3881901705 -0.2290761771
[71] 0.2047102114 -0.4173188068 0.1642142520 0.2012057300 -0.3124600240
[76] -0.1642988829 -0.2808107826 0.0604574631 0.1889260530 -0.0860653268
[81] 0.2004007529 0.4166655949 0.0766055922 0.2163056001 0.1788904371
[86] -0.0931796023 -0.0992108056 0.0733477890 -0.0414360816 -0.2649779307
[91] -0.0374798574 -0.4567878580 0.0173372938 0.1685311204 0.4154488342
[96] -0.0286970971 -0.2872348086 -0.0242903021 0.2735416462 0.0154785069
[101] -0.2650388799 -0.6031639988 0.1670292612 -0.0364159909 0.5377995206
[106] 0.4402215587 0.2353567729 -0.0243464448 -0.2412399410 0.2474356603
[111] 0.2307430586 -0.2130761168 -0.4555523710 0.3591468975 0.4289873308
[116] 0.1100491003 0.2100736982 0.4720842328 -0.2728847215 0.0667180463
[121] 0.0771422828 -0.1359726224 0.0864705277 0.3857590855 -0.2692011467
[126] -0.8507357392 -0.1007992169 0.0315913865 -0.0054612909 -0.3712841563
[131] -0.7147627050 0.1984898493 -0.4988567903 0.2734790723 -0.1831700896
[136] 0.3109147847 0.4445946235 0.2493067125 0.2198580264 0.5990780039
[141] -0.0431096884 -0.2874546992 -0.0628740057 -0.3719918836 0.2079692253
[146] -0.4327299142 0.3280609646 0.2760811882 0.3435933653 -0.1084263731
[151] -0.0024057156 0.0358010743 -0.1080758676 -0.1284480717 0.0302055766
[156] 0.0942203145 -0.2000452746 -0.1893058618 0.1578777155 0.0689249478
[161] -0.0184355230 0.1949796441 0.3420129139 -0.0131164389 -0.2907971941
[166] -0.0375518357 0.1982042423 0.3219515187 0.2269640571 -0.0902114078
[171] 0.2138645423 -0.0379034128 0.0008306282 0.4291613501 0.4751385321
[176] -0.4222731756 0.3951192260 0.0725276492 0.2279130102 0.2507501935
[181] -0.0195875183 -0.4280930622 -0.2153691590 0.3640589260 -0.1940475009
[186] -0.2683977916 0.2786470994 0.6155189754 -0.2123629005 -0.3478346127
[191] 0.4743544273 -0.2742177457 0.0131343419 0.2016811370 -0.0853824800
[196] 0.2017382324 0.2667942173 0.0245160680 0.0686663610 0.2510589988
[201] -0.0441618377 0.4976185644 -0.0250585955 -0.1973581679 0.1777186966
[206] 0.3663877385 0.7717254285 -0.5568337312 -0.1931534184 -0.0683450935
[211] 0.1534972101 -0.0042539108 0.4050570069 -0.0458415902 0.6323226977
[216] -0.0930479572 0.3524142300 -0.6530874341 -0.0137149890 -0.2120970369
[221] -0.0826544590 0.1580920807 0.5788018102 0.2045649617 -0.2597445820
[226] -0.3644855667 -0.4853035134 -0.6361422647 -0.3985010054 1.0381670244
>
> proc.time()
user system elapsed
2.157 9.395 15.391
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: 0x600000f9c120>
> .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: 0x600000f9c120>
> .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: 0x600000f9c120>
> .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: 0x600000f9c120>
> 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: 0x600000f9c420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000f9c420>
> .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: 0x600000f9c420>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000f9c420>
> .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: 0x600000f9c420>
> 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: 0x600000f9c600>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000f9c600>
> .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: 0x600000f9c600>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000f9c600>
> .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: 0x600000f9c600>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x600000f9c600>
> .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: 0x600000f9c600>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x600000f9c600>
> .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: 0x600000f9c600>
> 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: 0x600000f9c7e0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x600000f9c7e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000f9c7e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000f9c7e0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilecb3311a1b590" "BufferedMatrixFilecb33f9709fb"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFilecb3311a1b590" "BufferedMatrixFilecb33f9709fb"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000f9ca80>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000f9ca80>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000f9ca80>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x600000f9ca80>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x600000f9ca80>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x600000f9ca80>
> .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: 0x600000f9cc60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x600000f9cc60>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x600000f9cc60>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x600000f9cc60>
> 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: 0x600000f9ce40>
> .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: 0x600000f9ce40>
> rm(P)
>
> proc.time()
user system elapsed
0.348 0.116 0.524
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.343 0.091 0.529