| Back to Build/check report for BioC 3.22: simplified long |
|
This page was generated on 2026-03-23 11:57 -0400 (Mon, 23 Mar 2026).
| 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" | 4893 |
| 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 | |||||||||
| See other builds for BufferedMatrix in R Universe. | ||||||||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.74.0 |
| Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz |
| StartedAt: 2026-03-22 21:40:39 -0400 (Sun, 22 Mar 2026) |
| EndedAt: 2026-03-22 21:41:03 -0400 (Sun, 22 Mar 2026) |
| EllapsedTime: 24.2 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.2 (2025-10-31)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* 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 ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
* 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 loading without being on the library search path ... 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 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 re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE
Status: 2 NOTEs
See
‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.22-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
1580 | if (!(Matrix->readonly) & setting){
| ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
3327 | static int sort_double(const double *a1,const double *a2){
| ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.22-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.22-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.22-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.22-bioc/R/site-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 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
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.234 0.053 0.276
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
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] "/home/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) max used (Mb)
Ncells 478284 25.6 1046725 56 639600 34.2
Vcells 884773 6.8 8388608 64 2081613 15.9
>
>
>
>
> ##
> ## 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] "Sun Mar 22 21:40:54 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Sun Mar 22 21:40:54 2026"
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
>
>
> RowMode(tmp2)
<pointer: 0x617670ae5370>
>
>
>
> 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] "Sun Mar 22 21:40:54 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Sun Mar 22 21:40:54 2026"
>
> ColMode(tmp2)
<pointer: 0x617670ae5370>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 101.336765 0.1011475 -0.5403763 0.1245935
[2,] 2.944093 -0.9629539 -0.1299793 0.3365815
[3,] -1.617005 0.3476872 -1.1312273 1.2000246
[4,] 1.173009 0.9955806 -0.8330899 -0.3468349
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 101.336765 0.1011475 0.5403763 0.1245935
[2,] 2.944093 0.9629539 0.1299793 0.3365815
[3,] 1.617005 0.3476872 1.1312273 1.2000246
[4,] 1.173009 0.9955806 0.8330899 0.3468349
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.066616 0.3180369 0.7351029 0.3529780
[2,] 1.715836 0.9813022 0.3605265 0.5801564
[3,] 1.271615 0.5896501 1.0635917 1.0954563
[4,] 1.083055 0.9977878 0.9127376 0.5889269
>
> 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: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 227.00293 28.28152 32.89141 28.65437
[2,] 45.10245 35.77598 28.73524 31.13815
[3,] 39.33316 31.24419 36.76714 37.15459
[4,] 37.00356 35.97346 34.96047 31.23610
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x617671ae19b0>
> exp(tmp5)
<pointer: 0x617671ae19b0>
> log(tmp5,2)
<pointer: 0x617671ae19b0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 472.4769
> Min(tmp5)
[1] 52.60325
> mean(tmp5)
[1] 73.14216
> Sum(tmp5)
[1] 14628.43
> Var(tmp5)
[1] 891.4447
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 88.61255 71.14623 72.44421 72.12107 72.83125 70.86365 69.80556 71.41608
[9] 70.91551 71.26551
> rowSums(tmp5)
[1] 1772.251 1422.925 1448.884 1442.421 1456.625 1417.273 1396.111 1428.322
[9] 1418.310 1425.310
> rowVars(tmp5)
[1] 8204.95124 127.00339 112.22910 86.34591 69.08179 87.81956
[7] 105.11341 64.22194 104.35207 88.51047
> rowSd(tmp5)
[1] 90.581186 11.269578 10.593823 9.292250 8.311545 9.371209 10.252483
[8] 8.013859 10.215286 9.408000
> rowMax(tmp5)
[1] 472.47685 93.87485 85.64695 95.35349 93.19214 83.20396 87.66566
[8] 86.64027 85.54012 88.44712
> rowMin(tmp5)
[1] 53.54169 54.70234 53.86229 55.34363 55.61376 52.60325 55.46661 53.37022
[9] 56.18289 53.18988
>
> colMeans(tmp5)
[1] 119.78310 71.04612 67.51611 70.84625 64.71317 72.83927 72.31292
[8] 69.95738 68.48993 68.86954 67.78224 72.19166 73.93811 75.11933
[15] 75.49889 72.40333 69.29788 66.67332 74.81679 68.74788
> colSums(tmp5)
[1] 1197.8310 710.4612 675.1611 708.4625 647.1317 728.3927 723.1292
[8] 699.5738 684.8993 688.6954 677.8224 721.9166 739.3811 751.1933
[15] 754.9889 724.0333 692.9788 666.7332 748.1679 687.4788
> colVars(tmp5)
[1] 15439.98144 48.76881 93.28081 63.77493 30.57528 82.00711
[7] 123.35954 82.85464 96.35002 89.75410 83.68450 95.26717
[13] 84.37598 131.86390 27.93688 100.84743 69.09741 81.16622
[19] 55.71458 99.53052
> colSd(tmp5)
[1] 124.257722 6.983467 9.658199 7.985921 5.529492 9.055778
[7] 11.106734 9.102453 9.815805 9.473864 9.147923 9.760490
[13] 9.185640 11.483201 5.285535 10.042282 8.312485 9.009229
[19] 7.464220 9.976498
> colMax(tmp5)
[1] 472.47685 80.46845 82.48956 83.20396 72.65833 84.52205 88.44712
[8] 84.11451 86.64027 79.83737 79.18440 87.66566 87.99282 95.35349
[15] 83.54114 81.86331 81.08628 86.08548 89.74195 85.64695
> colMin(tmp5)
[1] 65.40405 58.86427 53.37022 59.64032 54.70566 55.50239 56.50964 52.60325
[9] 57.35647 53.86229 55.92645 58.08064 61.49857 53.18988 68.88939 55.34363
[17] 55.46661 53.54169 64.91275 56.72016
>
>
> ### 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.61255 71.14623 72.44421 72.12107 NA 70.86365 69.80556 71.41608
[9] 70.91551 71.26551
> rowSums(tmp5)
[1] 1772.251 1422.925 1448.884 1442.421 NA 1417.273 1396.111 1428.322
[9] 1418.310 1425.310
> rowVars(tmp5)
[1] 8204.95124 127.00339 112.22910 86.34591 71.10918 87.81956
[7] 105.11341 64.22194 104.35207 88.51047
> rowSd(tmp5)
[1] 90.581186 11.269578 10.593823 9.292250 8.432626 9.371209 10.252483
[8] 8.013859 10.215286 9.408000
> rowMax(tmp5)
[1] 472.47685 93.87485 85.64695 95.35349 NA 83.20396 87.66566
[8] 86.64027 85.54012 88.44712
> rowMin(tmp5)
[1] 53.54169 54.70234 53.86229 55.34363 NA 52.60325 55.46661 53.37022
[9] 56.18289 53.18988
>
> colMeans(tmp5)
[1] 119.78310 NA 67.51611 70.84625 64.71317 72.83927 72.31292
[8] 69.95738 68.48993 68.86954 67.78224 72.19166 73.93811 75.11933
[15] 75.49889 72.40333 69.29788 66.67332 74.81679 68.74788
> colSums(tmp5)
[1] 1197.8310 NA 675.1611 708.4625 647.1317 728.3927 723.1292
[8] 699.5738 684.8993 688.6954 677.8224 721.9166 739.3811 751.1933
[15] 754.9889 724.0333 692.9788 666.7332 748.1679 687.4788
> colVars(tmp5)
[1] 15439.98144 NA 93.28081 63.77493 30.57528 82.00711
[7] 123.35954 82.85464 96.35002 89.75410 83.68450 95.26717
[13] 84.37598 131.86390 27.93688 100.84743 69.09741 81.16622
[19] 55.71458 99.53052
> colSd(tmp5)
[1] 124.257722 NA 9.658199 7.985921 5.529492 9.055778
[7] 11.106734 9.102453 9.815805 9.473864 9.147923 9.760490
[13] 9.185640 11.483201 5.285535 10.042282 8.312485 9.009229
[19] 7.464220 9.976498
> colMax(tmp5)
[1] 472.47685 NA 82.48956 83.20396 72.65833 84.52205 88.44712
[8] 84.11451 86.64027 79.83737 79.18440 87.66566 87.99282 95.35349
[15] 83.54114 81.86331 81.08628 86.08548 89.74195 85.64695
> colMin(tmp5)
[1] 65.40405 NA 53.37022 59.64032 54.70566 55.50239 56.50964 52.60325
[9] 57.35647 53.86229 55.92645 58.08064 61.49857 53.18988 68.88939 55.34363
[17] 55.46661 53.54169 64.91275 56.72016
>
> Max(tmp5,na.rm=TRUE)
[1] 472.4769
> Min(tmp5,na.rm=TRUE)
[1] 52.60325
> mean(tmp5,na.rm=TRUE)
[1] 73.11576
> Sum(tmp5,na.rm=TRUE)
[1] 14550.04
> Var(tmp5,na.rm=TRUE)
[1] 895.8068
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 88.61255 71.14623 72.44421 72.12107 72.53840 70.86365 69.80556 71.41608
[9] 70.91551 71.26551
> rowSums(tmp5,na.rm=TRUE)
[1] 1772.251 1422.925 1448.884 1442.421 1378.230 1417.273 1396.111 1428.322
[9] 1418.310 1425.310
> rowVars(tmp5,na.rm=TRUE)
[1] 8204.95124 127.00339 112.22910 86.34591 71.10918 87.81956
[7] 105.11341 64.22194 104.35207 88.51047
> rowSd(tmp5,na.rm=TRUE)
[1] 90.581186 11.269578 10.593823 9.292250 8.432626 9.371209 10.252483
[8] 8.013859 10.215286 9.408000
> rowMax(tmp5,na.rm=TRUE)
[1] 472.47685 93.87485 85.64695 95.35349 93.19214 83.20396 87.66566
[8] 86.64027 85.54012 88.44712
> rowMin(tmp5,na.rm=TRUE)
[1] 53.54169 54.70234 53.86229 55.34363 55.61376 52.60325 55.46661 53.37022
[9] 56.18289 53.18988
>
> colMeans(tmp5,na.rm=TRUE)
[1] 119.78310 70.22954 67.51611 70.84625 64.71317 72.83927 72.31292
[8] 69.95738 68.48993 68.86954 67.78224 72.19166 73.93811 75.11933
[15] 75.49889 72.40333 69.29788 66.67332 74.81679 68.74788
> colSums(tmp5,na.rm=TRUE)
[1] 1197.8310 632.0659 675.1611 708.4625 647.1317 728.3927 723.1292
[8] 699.5738 684.8993 688.6954 677.8224 721.9166 739.3811 751.1933
[15] 754.9889 724.0333 692.9788 666.7332 748.1679 687.4788
> colVars(tmp5,na.rm=TRUE)
[1] 15439.98144 47.36334 93.28081 63.77493 30.57528 82.00711
[7] 123.35954 82.85464 96.35002 89.75410 83.68450 95.26717
[13] 84.37598 131.86390 27.93688 100.84743 69.09741 81.16622
[19] 55.71458 99.53052
> colSd(tmp5,na.rm=TRUE)
[1] 124.257722 6.882103 9.658199 7.985921 5.529492 9.055778
[7] 11.106734 9.102453 9.815805 9.473864 9.147923 9.760490
[13] 9.185640 11.483201 5.285535 10.042282 8.312485 9.009229
[19] 7.464220 9.976498
> colMax(tmp5,na.rm=TRUE)
[1] 472.47685 80.46845 82.48956 83.20396 72.65833 84.52205 88.44712
[8] 84.11451 86.64027 79.83737 79.18440 87.66566 87.99282 95.35349
[15] 83.54114 81.86331 81.08628 86.08548 89.74195 85.64695
> colMin(tmp5,na.rm=TRUE)
[1] 65.40405 58.86427 53.37022 59.64032 54.70566 55.50239 56.50964 52.60325
[9] 57.35647 53.86229 55.92645 58.08064 61.49857 53.18988 68.88939 55.34363
[17] 55.46661 53.54169 64.91275 56.72016
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 88.61255 71.14623 72.44421 72.12107 NaN 70.86365 69.80556 71.41608
[9] 70.91551 71.26551
> rowSums(tmp5,na.rm=TRUE)
[1] 1772.251 1422.925 1448.884 1442.421 0.000 1417.273 1396.111 1428.322
[9] 1418.310 1425.310
> rowVars(tmp5,na.rm=TRUE)
[1] 8204.95124 127.00339 112.22910 86.34591 NA 87.81956
[7] 105.11341 64.22194 104.35207 88.51047
> rowSd(tmp5,na.rm=TRUE)
[1] 90.581186 11.269578 10.593823 9.292250 NA 9.371209 10.252483
[8] 8.013859 10.215286 9.408000
> rowMax(tmp5,na.rm=TRUE)
[1] 472.47685 93.87485 85.64695 95.35349 NA 83.20396 87.66566
[8] 86.64027 85.54012 88.44712
> rowMin(tmp5,na.rm=TRUE)
[1] 53.54169 54.70234 53.86229 55.34363 NA 52.60325 55.46661 53.37022
[9] 56.18289 53.18988
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 122.73765 NaN 67.04816 70.45121 64.46187 72.06788 73.67034
[8] 69.75285 69.03442 67.65090 67.58380 71.27307 73.67269 74.75065
[15] 75.92261 74.26884 68.51834 66.75542 74.99087 68.69304
> colSums(tmp5,na.rm=TRUE)
[1] 1104.6389 0.0000 603.4335 634.0609 580.1569 648.6109 663.0331
[8] 627.7756 621.3098 608.8581 608.2542 641.4577 663.0542 672.7558
[15] 683.3035 668.4195 616.6650 600.7988 674.9178 618.2373
> colVars(tmp5,na.rm=TRUE)
[1] 17271.77367 NA 102.47748 69.99121 33.68672 85.56369
[7] 118.05022 92.74084 105.05847 84.26597 93.70208 97.68275
[13] 94.13045 146.81774 29.40925 74.30200 70.89808 91.23615
[19] 62.33801 111.93799
> colSd(tmp5,na.rm=TRUE)
[1] 131.422120 NA 10.123116 8.366075 5.804026 9.250064
[7] 10.865092 9.630205 10.249804 9.179650 9.679983 9.883458
[13] 9.702085 12.116837 5.423029 8.619861 8.420100 9.551762
[19] 7.895443 10.580075
> colMax(tmp5,na.rm=TRUE)
[1] 472.47685 -Inf 82.48956 83.20396 72.65833 84.52205 88.44712
[8] 84.11451 86.64027 78.58105 79.18440 87.66566 87.99282 95.35349
[15] 83.54114 81.86331 81.08628 86.08548 89.74195 85.64695
> colMin(tmp5,na.rm=TRUE)
[1] 65.40405 Inf 53.37022 59.64032 54.70566 55.50239 56.50964 52.60325
[9] 57.35647 53.86229 55.92645 58.08064 61.49857 53.18988 68.88939 55.34363
[17] 55.46661 53.54169 64.91275 56.72016
>
>
>
>
> 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] 222.6422 228.9234 342.5017 210.1214 202.7765 261.1832 299.2009 266.1116
[9] 266.4684 231.7469
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 222.6422 228.9234 342.5017 210.1214 202.7765 261.1832 299.2009 266.1116
[9] 266.4684 231.7469
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] 8.526513e-14 2.842171e-14 1.705303e-13 -8.526513e-14 5.684342e-14
[6] -5.684342e-14 2.842171e-14 0.000000e+00 -5.684342e-14 5.684342e-14
[11] 1.421085e-13 2.273737e-13 5.684342e-14 0.000000e+00 -1.421085e-13
[16] -8.526513e-14 -5.684342e-14 1.136868e-13 -5.684342e-14 2.842171e-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)
+ }
1 11
6 2
9 17
5 12
5 1
6 20
2 16
3 20
3 18
3 15
2 14
5 7
4 7
10 18
1 4
10 11
4 20
4 16
7 7
9 18
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] 1.600885
> Min(tmp)
[1] -3.16099
> mean(tmp)
[1] -0.3648076
> Sum(tmp)
[1] -36.48076
> Var(tmp)
[1] 0.9407856
>
> rowMeans(tmp)
[1] -0.3648076
> rowSums(tmp)
[1] -36.48076
> rowVars(tmp)
[1] 0.9407856
> rowSd(tmp)
[1] 0.969941
> rowMax(tmp)
[1] 1.600885
> rowMin(tmp)
[1] -3.16099
>
> colMeans(tmp)
[1] -0.86455601 -0.13642729 -0.59231407 -1.83500024 0.13357800 0.07565863
[7] 0.07210354 -0.16222781 -0.46264985 -0.68539757 0.90930791 -2.03089005
[13] 1.45558541 0.85433586 0.20995635 -0.58935359 -1.78825165 -0.13629219
[19] -0.99982433 0.19917741 -0.49977209 -3.16098967 -1.27178893 -0.35073517
[25] -0.42879331 -0.30099065 0.36489321 0.59120401 -0.12957227 -0.01281900
[31] -0.31534034 0.12222000 -0.97541796 -0.67509153 -0.54875117 -1.63895230
[37] 0.20253034 -0.51410600 -0.63164055 0.73232555 -1.81649823 0.06570283
[43] -1.22521500 -1.06737052 0.15644981 -1.78052841 -0.62641147 0.24505603
[49] -0.39652757 -0.87974441 -0.61379415 -0.25392877 -0.32344700 0.31011905
[55] 0.68452640 -1.23107433 1.07501038 -1.01081875 -1.05631212 -2.19728908
[61] 0.63321136 0.26160902 -1.79936004 -1.76080529 -0.86182082 -1.84056472
[67] 1.60088540 0.40675922 1.37171584 -1.35915388 -0.07908109 0.24643542
[73] -0.76030128 0.46728663 -0.87036679 -0.69987540 0.84057301 -1.65408307
[79] 0.08956786 0.71837495 -0.13218984 -1.64458837 -0.68898445 0.96639077
[85] 1.57590578 -1.06027189 -1.70666634 1.14279207 -0.24331975 0.45727512
[91] 0.17603661 -0.51075613 0.22560464 -2.56406915 0.50942830 -0.98228932
[97] 0.78058081 0.84824455 0.90961177 -1.73333967
> colSums(tmp)
[1] -0.86455601 -0.13642729 -0.59231407 -1.83500024 0.13357800 0.07565863
[7] 0.07210354 -0.16222781 -0.46264985 -0.68539757 0.90930791 -2.03089005
[13] 1.45558541 0.85433586 0.20995635 -0.58935359 -1.78825165 -0.13629219
[19] -0.99982433 0.19917741 -0.49977209 -3.16098967 -1.27178893 -0.35073517
[25] -0.42879331 -0.30099065 0.36489321 0.59120401 -0.12957227 -0.01281900
[31] -0.31534034 0.12222000 -0.97541796 -0.67509153 -0.54875117 -1.63895230
[37] 0.20253034 -0.51410600 -0.63164055 0.73232555 -1.81649823 0.06570283
[43] -1.22521500 -1.06737052 0.15644981 -1.78052841 -0.62641147 0.24505603
[49] -0.39652757 -0.87974441 -0.61379415 -0.25392877 -0.32344700 0.31011905
[55] 0.68452640 -1.23107433 1.07501038 -1.01081875 -1.05631212 -2.19728908
[61] 0.63321136 0.26160902 -1.79936004 -1.76080529 -0.86182082 -1.84056472
[67] 1.60088540 0.40675922 1.37171584 -1.35915388 -0.07908109 0.24643542
[73] -0.76030128 0.46728663 -0.87036679 -0.69987540 0.84057301 -1.65408307
[79] 0.08956786 0.71837495 -0.13218984 -1.64458837 -0.68898445 0.96639077
[85] 1.57590578 -1.06027189 -1.70666634 1.14279207 -0.24331975 0.45727512
[91] 0.17603661 -0.51075613 0.22560464 -2.56406915 0.50942830 -0.98228932
[97] 0.78058081 0.84824455 0.90961177 -1.73333967
> 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.86455601 -0.13642729 -0.59231407 -1.83500024 0.13357800 0.07565863
[7] 0.07210354 -0.16222781 -0.46264985 -0.68539757 0.90930791 -2.03089005
[13] 1.45558541 0.85433586 0.20995635 -0.58935359 -1.78825165 -0.13629219
[19] -0.99982433 0.19917741 -0.49977209 -3.16098967 -1.27178893 -0.35073517
[25] -0.42879331 -0.30099065 0.36489321 0.59120401 -0.12957227 -0.01281900
[31] -0.31534034 0.12222000 -0.97541796 -0.67509153 -0.54875117 -1.63895230
[37] 0.20253034 -0.51410600 -0.63164055 0.73232555 -1.81649823 0.06570283
[43] -1.22521500 -1.06737052 0.15644981 -1.78052841 -0.62641147 0.24505603
[49] -0.39652757 -0.87974441 -0.61379415 -0.25392877 -0.32344700 0.31011905
[55] 0.68452640 -1.23107433 1.07501038 -1.01081875 -1.05631212 -2.19728908
[61] 0.63321136 0.26160902 -1.79936004 -1.76080529 -0.86182082 -1.84056472
[67] 1.60088540 0.40675922 1.37171584 -1.35915388 -0.07908109 0.24643542
[73] -0.76030128 0.46728663 -0.87036679 -0.69987540 0.84057301 -1.65408307
[79] 0.08956786 0.71837495 -0.13218984 -1.64458837 -0.68898445 0.96639077
[85] 1.57590578 -1.06027189 -1.70666634 1.14279207 -0.24331975 0.45727512
[91] 0.17603661 -0.51075613 0.22560464 -2.56406915 0.50942830 -0.98228932
[97] 0.78058081 0.84824455 0.90961177 -1.73333967
> colMin(tmp)
[1] -0.86455601 -0.13642729 -0.59231407 -1.83500024 0.13357800 0.07565863
[7] 0.07210354 -0.16222781 -0.46264985 -0.68539757 0.90930791 -2.03089005
[13] 1.45558541 0.85433586 0.20995635 -0.58935359 -1.78825165 -0.13629219
[19] -0.99982433 0.19917741 -0.49977209 -3.16098967 -1.27178893 -0.35073517
[25] -0.42879331 -0.30099065 0.36489321 0.59120401 -0.12957227 -0.01281900
[31] -0.31534034 0.12222000 -0.97541796 -0.67509153 -0.54875117 -1.63895230
[37] 0.20253034 -0.51410600 -0.63164055 0.73232555 -1.81649823 0.06570283
[43] -1.22521500 -1.06737052 0.15644981 -1.78052841 -0.62641147 0.24505603
[49] -0.39652757 -0.87974441 -0.61379415 -0.25392877 -0.32344700 0.31011905
[55] 0.68452640 -1.23107433 1.07501038 -1.01081875 -1.05631212 -2.19728908
[61] 0.63321136 0.26160902 -1.79936004 -1.76080529 -0.86182082 -1.84056472
[67] 1.60088540 0.40675922 1.37171584 -1.35915388 -0.07908109 0.24643542
[73] -0.76030128 0.46728663 -0.87036679 -0.69987540 0.84057301 -1.65408307
[79] 0.08956786 0.71837495 -0.13218984 -1.64458837 -0.68898445 0.96639077
[85] 1.57590578 -1.06027189 -1.70666634 1.14279207 -0.24331975 0.45727512
[91] 0.17603661 -0.51075613 0.22560464 -2.56406915 0.50942830 -0.98228932
[97] 0.78058081 0.84824455 0.90961177 -1.73333967
> colMedians(tmp)
[1] -0.86455601 -0.13642729 -0.59231407 -1.83500024 0.13357800 0.07565863
[7] 0.07210354 -0.16222781 -0.46264985 -0.68539757 0.90930791 -2.03089005
[13] 1.45558541 0.85433586 0.20995635 -0.58935359 -1.78825165 -0.13629219
[19] -0.99982433 0.19917741 -0.49977209 -3.16098967 -1.27178893 -0.35073517
[25] -0.42879331 -0.30099065 0.36489321 0.59120401 -0.12957227 -0.01281900
[31] -0.31534034 0.12222000 -0.97541796 -0.67509153 -0.54875117 -1.63895230
[37] 0.20253034 -0.51410600 -0.63164055 0.73232555 -1.81649823 0.06570283
[43] -1.22521500 -1.06737052 0.15644981 -1.78052841 -0.62641147 0.24505603
[49] -0.39652757 -0.87974441 -0.61379415 -0.25392877 -0.32344700 0.31011905
[55] 0.68452640 -1.23107433 1.07501038 -1.01081875 -1.05631212 -2.19728908
[61] 0.63321136 0.26160902 -1.79936004 -1.76080529 -0.86182082 -1.84056472
[67] 1.60088540 0.40675922 1.37171584 -1.35915388 -0.07908109 0.24643542
[73] -0.76030128 0.46728663 -0.87036679 -0.69987540 0.84057301 -1.65408307
[79] 0.08956786 0.71837495 -0.13218984 -1.64458837 -0.68898445 0.96639077
[85] 1.57590578 -1.06027189 -1.70666634 1.14279207 -0.24331975 0.45727512
[91] 0.17603661 -0.51075613 0.22560464 -2.56406915 0.50942830 -0.98228932
[97] 0.78058081 0.84824455 0.90961177 -1.73333967
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.864556 -0.1364273 -0.5923141 -1.835 0.133578 0.07565863 0.07210354
[2,] -0.864556 -0.1364273 -0.5923141 -1.835 0.133578 0.07565863 0.07210354
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.1622278 -0.4626498 -0.6853976 0.9093079 -2.03089 1.455585 0.8543359
[2,] -0.1622278 -0.4626498 -0.6853976 0.9093079 -2.03089 1.455585 0.8543359
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.2099563 -0.5893536 -1.788252 -0.1362922 -0.9998243 0.1991774 -0.4997721
[2,] 0.2099563 -0.5893536 -1.788252 -0.1362922 -0.9998243 0.1991774 -0.4997721
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -3.16099 -1.271789 -0.3507352 -0.4287933 -0.3009907 0.3648932 0.591204
[2,] -3.16099 -1.271789 -0.3507352 -0.4287933 -0.3009907 0.3648932 0.591204
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.1295723 -0.012819 -0.3153403 0.12222 -0.975418 -0.6750915 -0.5487512
[2,] -0.1295723 -0.012819 -0.3153403 0.12222 -0.975418 -0.6750915 -0.5487512
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -1.638952 0.2025303 -0.514106 -0.6316406 0.7323256 -1.816498 0.06570283
[2,] -1.638952 0.2025303 -0.514106 -0.6316406 0.7323256 -1.816498 0.06570283
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -1.225215 -1.067371 0.1564498 -1.780528 -0.6264115 0.245056 -0.3965276
[2,] -1.225215 -1.067371 0.1564498 -1.780528 -0.6264115 0.245056 -0.3965276
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.8797444 -0.6137942 -0.2539288 -0.323447 0.3101191 0.6845264 -1.231074
[2,] -0.8797444 -0.6137942 -0.2539288 -0.323447 0.3101191 0.6845264 -1.231074
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 1.07501 -1.010819 -1.056312 -2.197289 0.6332114 0.261609 -1.79936
[2,] 1.07501 -1.010819 -1.056312 -2.197289 0.6332114 0.261609 -1.79936
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -1.760805 -0.8618208 -1.840565 1.600885 0.4067592 1.371716 -1.359154
[2,] -1.760805 -0.8618208 -1.840565 1.600885 0.4067592 1.371716 -1.359154
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.07908109 0.2464354 -0.7603013 0.4672866 -0.8703668 -0.6998754 0.840573
[2,] -0.07908109 0.2464354 -0.7603013 0.4672866 -0.8703668 -0.6998754 0.840573
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -1.654083 0.08956786 0.718375 -0.1321898 -1.644588 -0.6889844 0.9663908
[2,] -1.654083 0.08956786 0.718375 -0.1321898 -1.644588 -0.6889844 0.9663908
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 1.575906 -1.060272 -1.706666 1.142792 -0.2433198 0.4572751 0.1760366
[2,] 1.575906 -1.060272 -1.706666 1.142792 -0.2433198 0.4572751 0.1760366
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.5107561 0.2256046 -2.564069 0.5094283 -0.9822893 0.7805808 0.8482445
[2,] -0.5107561 0.2256046 -2.564069 0.5094283 -0.9822893 0.7805808 0.8482445
[,99] [,100]
[1,] 0.9096118 -1.73334
[2,] 0.9096118 -1.73334
>
>
> Max(tmp2)
[1] 2.291813
> Min(tmp2)
[1] -2.43466
> mean(tmp2)
[1] -0.03077844
> Sum(tmp2)
[1] -3.077844
> Var(tmp2)
[1] 0.8275869
>
> rowMeans(tmp2)
[1] 1.65793563 0.73738319 0.24967181 0.22864259 0.50706647 2.29181286
[7] 1.51050846 0.80597339 -1.45012816 -0.21215244 -1.57155997 -0.03195149
[13] -0.44788269 0.16082992 -0.05028011 1.32335096 0.45027412 -1.43657299
[19] -0.06859545 -0.69451691 0.42772585 0.40434726 -0.80083979 -0.20350870
[25] -0.90714080 0.70898185 0.57286707 -0.91079171 -0.08370043 1.41438275
[31] 0.88637554 -1.28081073 -0.17370448 0.36220769 -0.09457262 -0.05097947
[37] -1.33475448 -2.05937817 -1.68680708 1.00617125 -0.14264338 0.97198615
[43] 0.57704407 0.95770817 0.06514747 0.50956134 0.65371217 0.73345922
[49] -1.11762919 -0.81297124 -0.86964058 -0.01245528 1.19625241 -0.10460889
[55] -0.36201391 0.11979627 0.23164060 0.44146924 1.26233581 -2.01248315
[61] 0.56778684 -1.73634448 -0.98126451 -0.46207528 1.47812448 -0.34229504
[67] 0.51573909 -0.50129239 -2.30936198 0.67823740 0.47912792 0.25470562
[73] 0.37205820 0.53358959 -0.34273024 -2.43465959 -0.15858797 -1.11865570
[79] 0.20885577 -0.50269792 -0.59586797 0.26109870 0.17892421 -0.88564108
[85] 0.36422587 -0.47671925 0.70545155 -0.37982849 1.19281558 -0.64039699
[91] 0.21230290 -0.57255367 0.20284959 0.90258677 -0.02007927 -0.48780993
[97] 1.31282874 -0.67660722 -0.18661856 -0.12861275
> rowSums(tmp2)
[1] 1.65793563 0.73738319 0.24967181 0.22864259 0.50706647 2.29181286
[7] 1.51050846 0.80597339 -1.45012816 -0.21215244 -1.57155997 -0.03195149
[13] -0.44788269 0.16082992 -0.05028011 1.32335096 0.45027412 -1.43657299
[19] -0.06859545 -0.69451691 0.42772585 0.40434726 -0.80083979 -0.20350870
[25] -0.90714080 0.70898185 0.57286707 -0.91079171 -0.08370043 1.41438275
[31] 0.88637554 -1.28081073 -0.17370448 0.36220769 -0.09457262 -0.05097947
[37] -1.33475448 -2.05937817 -1.68680708 1.00617125 -0.14264338 0.97198615
[43] 0.57704407 0.95770817 0.06514747 0.50956134 0.65371217 0.73345922
[49] -1.11762919 -0.81297124 -0.86964058 -0.01245528 1.19625241 -0.10460889
[55] -0.36201391 0.11979627 0.23164060 0.44146924 1.26233581 -2.01248315
[61] 0.56778684 -1.73634448 -0.98126451 -0.46207528 1.47812448 -0.34229504
[67] 0.51573909 -0.50129239 -2.30936198 0.67823740 0.47912792 0.25470562
[73] 0.37205820 0.53358959 -0.34273024 -2.43465959 -0.15858797 -1.11865570
[79] 0.20885577 -0.50269792 -0.59586797 0.26109870 0.17892421 -0.88564108
[85] 0.36422587 -0.47671925 0.70545155 -0.37982849 1.19281558 -0.64039699
[91] 0.21230290 -0.57255367 0.20284959 0.90258677 -0.02007927 -0.48780993
[97] 1.31282874 -0.67660722 -0.18661856 -0.12861275
> rowVars(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
[1] 1.65793563 0.73738319 0.24967181 0.22864259 0.50706647 2.29181286
[7] 1.51050846 0.80597339 -1.45012816 -0.21215244 -1.57155997 -0.03195149
[13] -0.44788269 0.16082992 -0.05028011 1.32335096 0.45027412 -1.43657299
[19] -0.06859545 -0.69451691 0.42772585 0.40434726 -0.80083979 -0.20350870
[25] -0.90714080 0.70898185 0.57286707 -0.91079171 -0.08370043 1.41438275
[31] 0.88637554 -1.28081073 -0.17370448 0.36220769 -0.09457262 -0.05097947
[37] -1.33475448 -2.05937817 -1.68680708 1.00617125 -0.14264338 0.97198615
[43] 0.57704407 0.95770817 0.06514747 0.50956134 0.65371217 0.73345922
[49] -1.11762919 -0.81297124 -0.86964058 -0.01245528 1.19625241 -0.10460889
[55] -0.36201391 0.11979627 0.23164060 0.44146924 1.26233581 -2.01248315
[61] 0.56778684 -1.73634448 -0.98126451 -0.46207528 1.47812448 -0.34229504
[67] 0.51573909 -0.50129239 -2.30936198 0.67823740 0.47912792 0.25470562
[73] 0.37205820 0.53358959 -0.34273024 -2.43465959 -0.15858797 -1.11865570
[79] 0.20885577 -0.50269792 -0.59586797 0.26109870 0.17892421 -0.88564108
[85] 0.36422587 -0.47671925 0.70545155 -0.37982849 1.19281558 -0.64039699
[91] 0.21230290 -0.57255367 0.20284959 0.90258677 -0.02007927 -0.48780993
[97] 1.31282874 -0.67660722 -0.18661856 -0.12861275
> rowMin(tmp2)
[1] 1.65793563 0.73738319 0.24967181 0.22864259 0.50706647 2.29181286
[7] 1.51050846 0.80597339 -1.45012816 -0.21215244 -1.57155997 -0.03195149
[13] -0.44788269 0.16082992 -0.05028011 1.32335096 0.45027412 -1.43657299
[19] -0.06859545 -0.69451691 0.42772585 0.40434726 -0.80083979 -0.20350870
[25] -0.90714080 0.70898185 0.57286707 -0.91079171 -0.08370043 1.41438275
[31] 0.88637554 -1.28081073 -0.17370448 0.36220769 -0.09457262 -0.05097947
[37] -1.33475448 -2.05937817 -1.68680708 1.00617125 -0.14264338 0.97198615
[43] 0.57704407 0.95770817 0.06514747 0.50956134 0.65371217 0.73345922
[49] -1.11762919 -0.81297124 -0.86964058 -0.01245528 1.19625241 -0.10460889
[55] -0.36201391 0.11979627 0.23164060 0.44146924 1.26233581 -2.01248315
[61] 0.56778684 -1.73634448 -0.98126451 -0.46207528 1.47812448 -0.34229504
[67] 0.51573909 -0.50129239 -2.30936198 0.67823740 0.47912792 0.25470562
[73] 0.37205820 0.53358959 -0.34273024 -2.43465959 -0.15858797 -1.11865570
[79] 0.20885577 -0.50269792 -0.59586797 0.26109870 0.17892421 -0.88564108
[85] 0.36422587 -0.47671925 0.70545155 -0.37982849 1.19281558 -0.64039699
[91] 0.21230290 -0.57255367 0.20284959 0.90258677 -0.02007927 -0.48780993
[97] 1.31282874 -0.67660722 -0.18661856 -0.12861275
>
> colMeans(tmp2)
[1] -0.03077844
> colSums(tmp2)
[1] -3.077844
> colVars(tmp2)
[1] 0.8275869
> colSd(tmp2)
[1] 0.9097181
> colMax(tmp2)
[1] 2.291813
> colMin(tmp2)
[1] -2.43466
> colMedians(tmp2)
[1] -0.01626728
> colRanges(tmp2)
[,1]
[1,] -2.434660
[2,] 2.291813
>
> 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.4911951 3.1146529 -1.9965835 -4.5432408 -0.7392332 -3.3458076
[7] 1.0325325 9.0765760 1.1303355 -1.2910626
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.1869665
[2,] -0.2439468
[3,] 0.4803196
[4,] 0.9427097
[5,] 1.9953765
>
> rowApply(tmp,sum)
[1] 0.6564842 2.2076366 1.4211276 -0.1642728 5.8406323 4.1583128
[7] -0.2010834 -6.5157211 -2.6064306 0.1326790
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 9 2 8 10 2 4 9 2 9 7
[2,] 10 1 9 1 9 10 6 4 6 2
[3,] 5 3 3 6 3 8 2 7 4 8
[4,] 8 10 5 5 1 9 3 1 2 3
[5,] 4 8 1 2 8 3 10 8 1 6
[6,] 1 4 2 3 6 1 7 6 10 1
[7,] 6 9 6 4 7 2 5 9 8 4
[8,] 7 5 10 8 10 7 8 10 7 5
[9,] 2 6 7 9 4 6 1 5 5 10
[10,] 3 7 4 7 5 5 4 3 3 9
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 1.6453402 2.3151666 1.7571822 -0.5058263 -0.7706119 0.5597991
[7] -0.3547460 3.4058851 0.4007452 -1.9729144 -1.8179209 1.2585098
[13] -3.2553265 -0.4767456 1.3965340 0.5415937 -2.7986609 -2.2432797
[19] 0.5660706 -1.5395800
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.6023949
[2,] 0.1451110
[3,] 0.3125120
[4,] 0.7767509
[5,] 2.0133611
>
> rowApply(tmp,sum)
[1] 0.6724149 3.7402042 -0.3870961 -4.1817759 -1.7325329
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 12 19 18 15 3
[2,] 13 17 16 9 13
[3,] 3 20 17 4 19
[4,] 14 18 1 2 10
[5,] 9 7 15 16 5
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.3125120 0.3238504 -0.8774029 0.4084504 -0.2758565 0.4379681
[2,] 2.0133611 1.3366921 2.0289869 1.4029170 -0.6569689 0.7645885
[3,] 0.7767509 0.6266894 0.7384260 -0.9731460 0.5904426 -0.6274497
[4,] 0.1451110 -0.3002772 -1.1752470 -1.2942256 0.3189399 -0.2578392
[5,] -1.6023949 0.3282120 1.0424192 -0.0498221 -0.7471690 0.2425314
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.442524585 0.81829038 -0.6126953 -0.6066949 -1.21884827 0.6072511
[2,] -0.008896456 0.07736284 -0.1260336 -0.7971987 -0.75247837 0.5549990
[3,] -0.158153904 0.29894737 -0.1961036 0.8954188 0.21760484 -0.6817824
[4,] -0.289461765 1.82196434 0.8990360 -0.4434963 -0.03240970 -1.3099057
[5,] 0.544290729 0.38932014 0.4365417 -1.0209432 -0.03178937 2.0879478
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -2.0564031 1.1731284 -0.5378043 2.5574662 0.2366133 -0.7918441
[2,] -0.6521805 0.8731718 -1.0956999 0.8205409 -1.1266436 0.5116047
[3,] -0.1834529 -0.8920323 1.2158735 -0.9625095 -0.6940434 -0.3508796
[4,] -1.0732344 -1.1443135 0.7775710 -0.1948091 -0.8550258 -1.2503953
[5,] 0.7099443 -0.4867001 1.0365937 -1.6790948 -0.3595615 -0.3617655
[,19] [,20]
[1,] 0.10471297 1.11224549
[2,] -0.69426541 -0.73365519
[3,] 0.07520386 -0.10290010
[4,] 1.50521100 -0.02896839
[5,] -0.42479182 -1.78630179
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /home/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: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 653 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 565 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/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.00711825 0.2332301 -0.5272811 -1.786904 -1.630812 1.08854 -1.577706
col8 col9 col10 col11 col12 col13 col14
row1 1.019292 1.719508 -1.881108 -2.527962 0.7625479 -1.303206 -1.393439
col15 col16 col17 col18 col19 col20
row1 0.1238404 0.6916384 -0.2824708 1.259183 0.7622784 -0.3427914
> tmp[,"col10"]
col10
row1 -1.8811085
row2 2.5481140
row3 1.6706363
row4 0.4176495
row5 0.1933904
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -0.00711825 0.23323011 -0.5272811 -1.7869038 -1.6308122 1.0885397
row5 -0.70140613 -0.05118813 0.4237838 -0.5222279 -0.4852696 0.7107656
col7 col8 col9 col10 col11 col12 col13
row1 -1.5777056 1.019292 1.71950800 -1.8811085 -2.5279618 0.7625479 -1.3032060
row5 -0.0324052 2.482520 0.02286841 0.1933904 -0.3573364 -1.2047101 0.5429455
col14 col15 col16 col17 col18 col19
row1 -1.3934392 0.1238404 0.6916384 -0.2824708 1.25918269 0.7622784
row5 -0.2768449 -0.6269695 0.7305834 0.3004452 0.08216653 -1.4804646
col20
row1 -0.3427914
row5 1.6384616
> tmp[,c("col6","col20")]
col6 col20
row1 1.0885397 -0.3427914
row2 -0.7108292 1.0838498
row3 0.5235754 0.6035208
row4 0.7452369 1.7487846
row5 0.7107656 1.6384616
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 1.0885397 -0.3427914
row5 0.7107656 1.6384616
>
>
>
>
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105)
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.95266 51.44 49.42698 48.73854 47.69513 105.647 53.29472 51.06042
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.50881 49.87114 50.4681 50.8244 50.4245 51.38064 50.57592 50.1921
col17 col18 col19 col20
row1 50.54294 52.11346 51.54707 105.4596
> tmp[,"col10"]
col10
row1 49.87114
row2 31.36243
row3 29.23128
row4 28.98922
row5 49.76090
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.95266 51.4400 49.42698 48.73854 47.69513 105.6470 53.29472 51.06042
row5 48.98384 50.0021 48.42588 49.35553 50.41817 105.4087 50.38359 49.48330
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.50881 49.87114 50.46810 50.82440 50.42450 51.38064 50.57592 50.19210
row5 51.72956 49.76090 50.40384 49.92153 48.87847 50.00640 52.71087 49.15018
col17 col18 col19 col20
row1 50.54294 52.11346 51.54707 105.4596
row5 48.69606 49.19980 50.62622 104.0920
> tmp[,c("col6","col20")]
col6 col20
row1 105.64705 105.45964
row2 75.02971 74.21665
row3 76.01041 75.98109
row4 74.08999 75.16543
row5 105.40870 104.09203
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.6470 105.4596
row5 105.4087 104.0920
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.6470 105.4596
row5 105.4087 104.0920
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.4337540
[2,] -0.9518818
[3,] 1.0838538
[4,] 1.2571756
[5,] -1.1146532
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.41129956 -0.26958854
[2,] -1.38327872 -1.23891508
[3,] -0.50682253 -1.57901508
[4,] 0.01752803 -0.73783744
[5,] 0.90289335 0.09390478
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.5020874 0.8370468
[2,] 0.1624350 -0.6418484
[3,] -1.3349893 -0.2886788
[4,] 1.2073876 0.2368709
[5,] 0.7792141 -0.7312134
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.5020874
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.5020874
[2,] 0.1624350
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row3 0.9885786 0.7341698 -2.6176897 -2.6899348 0.1864670 -0.4592788 0.2118818
row1 0.8990588 1.3060841 0.7542033 -0.2466907 0.8593551 1.8454875 0.8938555
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 0.2654461 -0.1024328 -0.6169022 1.836553 0.1749291 0.1446689 -0.07745983
row1 0.8894252 -0.2640603 -0.1346911 1.386729 0.6781931 0.1702499 -1.19600445
[,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.4494725 -0.4720097 1.0815430 -1.675009 0.5023316 0.4937334
row1 0.9731739 0.0700189 -0.1771233 -1.563279 -0.1641927 1.5053414
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -1.749238 0.2663068 -0.2069201 -0.1491573 -1.090325 -0.7023687 1.814451
[,8] [,9] [,10]
row2 0.1121907 0.2465493 1.170995
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.1077753 -0.4145197 0.7967695 0.1896218 1.170186 -1.158405 -0.3158918
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.291903 -1.166369 0.6048219 -0.1313068 0.2961734 1.047861 -0.1393886
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.2475648 0.08895782 0.4196619 1.039387 0.7790278 0.08061009
>
>
> 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: 0x617670871f10>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29ae632f8dfca5"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29ae6318b30e74"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29ae6366d39a88"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29ae635facff83"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29ae6356541b5a"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29ae63d47f11b"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29ae6322e68b09"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29ae637994ab12"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29ae63f6637fa"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29ae637243441d"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29ae632bb6ece4"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29ae6372e4cd57"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29ae634f125c12"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29ae63261d2574"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29ae636a02c618"
>
>
> ### 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: 0x6176703a3b30>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6176703a3b30>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x6176703a3b30>
> rowMedians(tmp)
[1] -0.277005005 -0.244748148 -0.010664431 0.344195757 -0.307351043
[6] -0.369067427 -0.149652346 0.306006783 -0.153851762 -0.451329494
[11] 0.311179666 -0.206425133 0.166580609 0.519447987 0.117553560
[16] -0.231203520 -0.092577155 -0.154687561 0.131284076 -0.349633051
[21] 0.068818913 -0.207729202 0.068837304 0.115089597 0.089768149
[26] -0.293396228 -0.345565349 0.066820908 0.149566398 0.141499207
[31] -0.515467435 0.297399157 0.302381922 -0.395965357 0.017431163
[36] -0.093327674 -0.486745754 -0.334391014 0.327062183 -0.130045761
[41] 0.242305032 -0.543599688 0.013832312 0.364755822 0.136643705
[46] 0.203238521 0.412827122 -0.294855088 0.105029590 -0.585845407
[51] 0.821644835 0.587179163 -0.109320753 -0.170807374 -0.076987866
[56] 0.184130935 0.109717526 -0.353337902 -0.090436267 -0.177984680
[61] -0.005700699 -0.283521218 0.370010579 -0.174023674 0.026606595
[66] 0.055567383 -0.222170505 0.366177600 -0.613298736 -0.091897388
[71] -0.417066323 -0.662989597 0.001424334 0.533680516 -0.118574513
[76] 0.274395765 -0.242545120 0.031684522 -0.056337814 0.125428379
[81] 0.144911476 -0.486719846 0.423627786 0.428477036 0.028918421
[86] 0.237364045 -0.638202087 0.242566941 0.140219708 -0.259804989
[91] 0.432479117 -0.089933669 0.110107141 0.283801812 -0.317035955
[96] -0.507676559 0.302433754 -0.337967591 -0.264876614 -0.596901312
[101] -0.388004312 -0.037126240 0.178342561 0.113181134 0.197554960
[106] 0.047391820 -0.201232379 -0.040863574 0.117618439 -0.057414802
[111] 0.321497664 0.165006679 0.324890743 -0.085739117 0.144790526
[116] 0.129933418 -0.185024725 -0.755172802 0.013756969 -0.365048066
[121] -0.187844844 -0.142823658 0.121760024 -0.257125447 -0.025605469
[126] 0.026131334 0.315412695 0.073322749 -0.073883966 -0.471598138
[131] 0.760231746 0.146442132 -0.268932702 0.074018025 0.588555767
[136] 0.026064111 -0.081746446 0.093609133 -0.033768092 0.038521608
[141] -0.384206547 -0.207785299 0.096992807 -0.510459534 -0.518036712
[146] 0.212578058 0.113724326 0.042404334 -0.163338240 0.360849078
[151] -0.185897781 -0.183705645 0.109304337 0.337865238 -0.205746359
[156] -0.079270895 0.569651665 -0.016915945 -0.085853108 -0.019959752
[161] 0.077509376 0.154903208 0.347808160 0.017923272 0.051622529
[166] 0.208421818 0.085305467 0.831205835 -0.145492540 0.161707713
[171] -0.041705654 0.226367139 0.406786207 -0.115513022 -0.321302482
[176] -0.211960856 -0.006272556 0.345264216 -0.635500501 -0.691171392
[181] -0.018234025 0.271871379 -0.430196995 -0.034215257 -0.553096761
[186] 0.016968399 -0.244727584 -0.719493413 0.743767152 0.477051473
[191] -0.143193257 -0.448883461 -0.205348410 -0.022324952 0.330994702
[196] 0.258878189 0.568788174 -0.120496420 -0.369339996 -0.036461115
[201] -0.025373911 0.323556432 0.162713410 0.153169284 0.500946214
[206] -0.001148406 0.228357598 -0.066315735 0.082545310 0.113383125
[211] -0.148527008 -0.107124528 0.001546657 0.077601817 -1.115393986
[216] 0.296727361 0.340197129 -0.404249669 -0.111805650 -0.287796021
[221] 0.209760866 0.229403330 -0.273843036 -0.185748752 -0.506151318
[226] -0.761659088 0.326194757 -0.115928728 0.008144176 -0.133589225
>
> proc.time()
user system elapsed
1.225 0.643 1.856
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
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: 0x5fa6baaa3370>
> .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: 0x5fa6baaa3370>
> .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: 0x5fa6baaa3370>
> .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: 0x5fa6baaa3370>
> 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: 0x5fa6baa8b1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5fa6baa8b1c0>
> .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: 0x5fa6baa8b1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5fa6baa8b1c0>
> .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: 0x5fa6baa8b1c0>
> 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: 0x5fa6bad6e120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5fa6bad6e120>
> .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: 0x5fa6bad6e120>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5fa6bad6e120>
> .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: 0x5fa6bad6e120>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5fa6bad6e120>
> .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: 0x5fa6bad6e120>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5fa6bad6e120>
> .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: 0x5fa6bad6e120>
> 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: 0x5fa6b9abe390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5fa6b9abe390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5fa6b9abe390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5fa6b9abe390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile29aecb3325692a" "BufferedMatrixFile29aecb3e31b3fa"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile29aecb3325692a" "BufferedMatrixFile29aecb3e31b3fa"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5fa6b99b53d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5fa6b99b53d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5fa6b99b53d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5fa6b99b53d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5fa6b99b53d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5fa6b99b53d0>
> .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: 0x5fa6bb4eafa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5fa6bb4eafa0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5fa6bb4eafa0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5fa6bb4eafa0>
> 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: 0x5fa6b9cc2ff0>
> .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: 0x5fa6b9cc2ff0>
> rm(P)
>
> proc.time()
user system elapsed
0.231 0.048 0.270
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
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.238 0.042 0.271