| Back to Build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-02-09 11:32 -0500 (Mon, 09 Feb 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences" | 4858 |
| 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 254/2347 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | 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.75.0 |
| Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz |
| StartedAt: 2026-02-08 21:53:24 -0500 (Sun, 08 Feb 2026) |
| EndedAt: 2026-02-08 21:53:49 -0500 (Sun, 08 Feb 2026) |
| EllapsedTime: 25.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2026-01-15 r89304)
* 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.75.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 ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* 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: 1 NOTE
See
‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.23-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.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.23-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.23-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.23-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.23-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.23-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.23-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.23-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 Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 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.277
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 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.23-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 478920 25.6 1048721 56.1 639242 34.2
Vcells 885815 6.8 8388608 64.0 2083259 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 Feb 8 21:53:39 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 Feb 8 21:53:39 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: 0x63854f4c2c10>
>
>
>
> 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 Feb 8 21:53:40 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 Feb 8 21:53:40 2026"
>
> ColMode(tmp2)
<pointer: 0x63854f4c2c10>
>
>
>
> ### 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,] 99.070128 2.878964 -1.5807104 0.3357334
[2,] -1.832117 1.524782 0.8405199 -0.2655306
[3,] 1.029965 1.641595 -0.1569280 -0.2812053
[4,] -2.052064 -1.272292 -1.4682255 -0.3355713
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-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,] 99.070128 2.878964 1.5807104 0.3357334
[2,] 1.832117 1.524782 0.8405199 0.2655306
[3,] 1.029965 1.641595 0.1569280 0.2812053
[4,] 2.052064 1.272292 1.4682255 0.3355713
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-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,] 9.953398 1.696751 1.2572630 0.5794250
[2,] 1.353557 1.234821 0.9167987 0.5152966
[3,] 1.014872 1.281247 0.3961414 0.5302880
[4,] 1.432503 1.127959 1.2117035 0.5792851
>
> 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.23-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,] 223.60411 44.84647 39.15334 31.12998
[2,] 40.36769 38.87299 35.00851 30.41850
[3,] 36.17868 39.45407 29.11834 30.58408
[4,] 41.37709 37.55188 38.58526 31.12842
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x638550319ff0>
> exp(tmp5)
<pointer: 0x638550319ff0>
> log(tmp5,2)
<pointer: 0x638550319ff0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 465.4027
> Min(tmp5)
[1] 53.13072
> mean(tmp5)
[1] 72.97132
> Sum(tmp5)
[1] 14594.26
> Var(tmp5)
[1] 851.7418
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.80880 72.06410 68.00636 70.63952 71.05916 71.07118 70.76601 71.33391
[9] 73.05993 71.90425
> rowSums(tmp5)
[1] 1796.176 1441.282 1360.127 1412.790 1421.183 1421.424 1415.320 1426.678
[9] 1461.199 1438.085
> rowVars(tmp5)
[1] 7898.36055 57.15780 61.69419 66.35695 71.13993 55.52687
[7] 133.20398 78.33571 72.18635 79.15485
> rowSd(tmp5)
[1] 88.872721 7.560278 7.854565 8.145977 8.434449 7.451635 11.541403
[8] 8.850746 8.496255 8.896901
> rowMax(tmp5)
[1] 465.40265 84.02005 82.96912 86.12100 86.38893 82.03783 88.54803
[8] 86.92908 91.08784 91.35591
> rowMin(tmp5)
[1] 55.82041 58.50404 54.04644 60.13283 55.37783 56.23677 53.13072 54.72357
[9] 58.83862 55.17682
>
> colMeans(tmp5)
[1] 112.99383 78.16606 73.45808 71.81050 67.98368 69.28545 72.76919
[8] 68.20796 72.00197 70.46779 67.16862 71.09576 69.28093 71.39162
[15] 73.41652 70.33782 69.78600 68.39024 72.86081 68.55363
> colSums(tmp5)
[1] 1129.9383 781.6606 734.5808 718.1050 679.8368 692.8545 727.6919
[8] 682.0796 720.0197 704.6779 671.6862 710.9576 692.8093 713.9162
[15] 734.1652 703.3782 697.8600 683.9024 728.6081 685.5363
> colVars(tmp5)
[1] 15427.99836 115.20666 69.67804 96.23654 48.42286 76.09781
[7] 91.90031 42.01141 80.90922 68.28889 38.54009 75.34558
[13] 38.04016 100.45501 34.37333 80.92562 96.59092 123.70343
[19] 34.23925 83.02953
> colSd(tmp5)
[1] 124.209494 10.733437 8.347337 9.810022 6.958653 8.723406
[7] 9.586465 6.481621 8.994955 8.263709 6.208066 8.680183
[13] 6.167670 10.022725 5.862877 8.995867 9.828068 11.122204
[19] 5.851431 9.112054
> colMax(tmp5)
[1] 465.40265 93.34206 86.49979 88.54803 74.32154 79.26058 86.38893
[8] 74.67464 82.96912 87.48403 76.68147 86.92908 80.24342 86.40000
[15] 79.59010 79.75334 84.61987 91.35591 80.23750 83.19632
> colMin(tmp5)
[1] 54.52315 60.53888 60.60601 63.31212 56.23677 55.17682 59.21648 54.04644
[9] 56.02792 60.62312 54.72357 59.11276 57.20782 57.16756 63.29984 55.37783
[17] 58.69361 53.13072 60.75290 55.82041
>
>
> ### 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] 89.80880 72.06410 68.00636 NA 71.05916 71.07118 70.76601 71.33391
[9] 73.05993 71.90425
> rowSums(tmp5)
[1] 1796.176 1441.282 1360.127 NA 1421.183 1421.424 1415.320 1426.678
[9] 1461.199 1438.085
> rowVars(tmp5)
[1] 7898.36055 57.15780 61.69419 69.28237 71.13993 55.52687
[7] 133.20398 78.33571 72.18635 79.15485
> rowSd(tmp5)
[1] 88.872721 7.560278 7.854565 8.323603 8.434449 7.451635 11.541403
[8] 8.850746 8.496255 8.896901
> rowMax(tmp5)
[1] 465.40265 84.02005 82.96912 NA 86.38893 82.03783 88.54803
[8] 86.92908 91.08784 91.35591
> rowMin(tmp5)
[1] 55.82041 58.50404 54.04644 NA 55.37783 56.23677 53.13072 54.72357
[9] 58.83862 55.17682
>
> colMeans(tmp5)
[1] 112.99383 78.16606 73.45808 71.81050 NA 69.28545 72.76919
[8] 68.20796 72.00197 70.46779 67.16862 71.09576 69.28093 71.39162
[15] 73.41652 70.33782 69.78600 68.39024 72.86081 68.55363
> colSums(tmp5)
[1] 1129.9383 781.6606 734.5808 718.1050 NA 692.8545 727.6919
[8] 682.0796 720.0197 704.6779 671.6862 710.9576 692.8093 713.9162
[15] 734.1652 703.3782 697.8600 683.9024 728.6081 685.5363
> colVars(tmp5)
[1] 15427.99836 115.20666 69.67804 96.23654 NA 76.09781
[7] 91.90031 42.01141 80.90922 68.28889 38.54009 75.34558
[13] 38.04016 100.45501 34.37333 80.92562 96.59092 123.70343
[19] 34.23925 83.02953
> colSd(tmp5)
[1] 124.209494 10.733437 8.347337 9.810022 NA 8.723406
[7] 9.586465 6.481621 8.994955 8.263709 6.208066 8.680183
[13] 6.167670 10.022725 5.862877 8.995867 9.828068 11.122204
[19] 5.851431 9.112054
> colMax(tmp5)
[1] 465.40265 93.34206 86.49979 88.54803 NA 79.26058 86.38893
[8] 74.67464 82.96912 87.48403 76.68147 86.92908 80.24342 86.40000
[15] 79.59010 79.75334 84.61987 91.35591 80.23750 83.19632
> colMin(tmp5)
[1] 54.52315 60.53888 60.60601 63.31212 NA 55.17682 59.21648 54.04644
[9] 56.02792 60.62312 54.72357 59.11276 57.20782 57.16756 63.29984 55.37783
[17] 58.69361 53.13072 60.75290 55.82041
>
> Max(tmp5,na.rm=TRUE)
[1] 465.4027
> Min(tmp5,na.rm=TRUE)
[1] 53.13072
> mean(tmp5,na.rm=TRUE)
[1] 72.96491
> Sum(tmp5,na.rm=TRUE)
[1] 14520.02
> Var(tmp5,na.rm=TRUE)
[1] 856.0353
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.80880 72.06410 68.00636 70.44965 71.05916 71.07118 70.76601 71.33391
[9] 73.05993 71.90425
> rowSums(tmp5,na.rm=TRUE)
[1] 1796.176 1441.282 1360.127 1338.543 1421.183 1421.424 1415.320 1426.678
[9] 1461.199 1438.085
> rowVars(tmp5,na.rm=TRUE)
[1] 7898.36055 57.15780 61.69419 69.28237 71.13993 55.52687
[7] 133.20398 78.33571 72.18635 79.15485
> rowSd(tmp5,na.rm=TRUE)
[1] 88.872721 7.560278 7.854565 8.323603 8.434449 7.451635 11.541403
[8] 8.850746 8.496255 8.896901
> rowMax(tmp5,na.rm=TRUE)
[1] 465.40265 84.02005 82.96912 86.12100 86.38893 82.03783 88.54803
[8] 86.92908 91.08784 91.35591
> rowMin(tmp5,na.rm=TRUE)
[1] 55.82041 58.50404 54.04644 60.13283 55.37783 56.23677 53.13072 54.72357
[9] 58.83862 55.17682
>
> colMeans(tmp5,na.rm=TRUE)
[1] 112.99383 78.16606 73.45808 71.81050 67.28775 69.28545 72.76919
[8] 68.20796 72.00197 70.46779 67.16862 71.09576 69.28093 71.39162
[15] 73.41652 70.33782 69.78600 68.39024 72.86081 68.55363
> colSums(tmp5,na.rm=TRUE)
[1] 1129.9383 781.6606 734.5808 718.1050 605.5897 692.8545 727.6919
[8] 682.0796 720.0197 704.6779 671.6862 710.9576 692.8093 713.9162
[15] 734.1652 703.3782 697.8600 683.9024 728.6081 685.5363
> colVars(tmp5,na.rm=TRUE)
[1] 15427.99836 115.20666 69.67804 96.23654 49.02710 76.09781
[7] 91.90031 42.01141 80.90922 68.28889 38.54009 75.34558
[13] 38.04016 100.45501 34.37333 80.92562 96.59092 123.70343
[19] 34.23925 83.02953
> colSd(tmp5,na.rm=TRUE)
[1] 124.209494 10.733437 8.347337 9.810022 7.001935 8.723406
[7] 9.586465 6.481621 8.994955 8.263709 6.208066 8.680183
[13] 6.167670 10.022725 5.862877 8.995867 9.828068 11.122204
[19] 5.851431 9.112054
> colMax(tmp5,na.rm=TRUE)
[1] 465.40265 93.34206 86.49979 88.54803 74.32154 79.26058 86.38893
[8] 74.67464 82.96912 87.48403 76.68147 86.92908 80.24342 86.40000
[15] 79.59010 79.75334 84.61987 91.35591 80.23750 83.19632
> colMin(tmp5,na.rm=TRUE)
[1] 54.52315 60.53888 60.60601 63.31212 56.23677 55.17682 59.21648 54.04644
[9] 56.02792 60.62312 54.72357 59.11276 57.20782 57.16756 63.29984 55.37783
[17] 58.69361 53.13072 60.75290 55.82041
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.80880 72.06410 68.00636 NaN 71.05916 71.07118 70.76601 71.33391
[9] 73.05993 71.90425
> rowSums(tmp5,na.rm=TRUE)
[1] 1796.176 1441.282 1360.127 0.000 1421.183 1421.424 1415.320 1426.678
[9] 1461.199 1438.085
> rowVars(tmp5,na.rm=TRUE)
[1] 7898.36055 57.15780 61.69419 NA 71.13993 55.52687
[7] 133.20398 78.33571 72.18635 79.15485
> rowSd(tmp5,na.rm=TRUE)
[1] 88.872721 7.560278 7.854565 NA 8.434449 7.451635 11.541403
[8] 8.850746 8.496255 8.896901
> rowMax(tmp5,na.rm=TRUE)
[1] 465.40265 84.02005 82.96912 NA 86.38893 82.03783 88.54803
[8] 86.92908 91.08784 91.35591
> rowMin(tmp5,na.rm=TRUE)
[1] 55.82041 58.50404 54.04644 NA 55.37783 56.23677 53.13072 54.72357
[9] 58.83862 55.17682
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 115.97970 78.16680 72.69674 72.59058 NaN 68.21525 73.78747
[8] 67.83021 71.76763 70.42307 67.93991 71.91241 69.45343 72.37410
[15] 73.09721 71.17381 70.85858 67.92079 74.20613 66.92666
> colSums(tmp5,na.rm=TRUE)
[1] 1043.8173 703.5012 654.2707 653.3153 0.0000 613.9373 664.0872
[8] 610.4719 645.9087 633.8076 611.4592 647.2117 625.0809 651.3669
[15] 657.8749 640.5643 637.7272 611.2871 667.8552 602.3399
> colVars(tmp5,na.rm=TRUE)
[1] 17256.19965 129.60749 71.86682 101.42011 NA 72.72533
[7] 91.72293 45.65749 90.40510 76.80250 36.66506 77.26094
[13] 42.46044 102.15266 37.52295 83.17887 95.72260 136.68709
[19] 18.15785 63.62926
> colSd(tmp5,na.rm=TRUE)
[1] 131.362855 11.384528 8.477430 10.070755 NA 8.527915
[7] 9.577209 6.757033 9.508159 8.763703 6.055168 8.789820
[13] 6.516167 10.107060 6.125598 9.120245 9.783793 11.691325
[19] 4.261203 7.976795
> colMax(tmp5,na.rm=TRUE)
[1] 465.40265 93.34206 86.49979 88.54803 -Inf 79.26058 86.38893
[8] 74.67464 82.96912 87.48403 76.68147 86.92908 80.24342 86.40000
[15] 79.59010 79.75334 84.61987 91.35591 80.23750 79.70862
> colMin(tmp5,na.rm=TRUE)
[1] 54.52315 60.53888 60.60601 63.31212 Inf 55.17682 59.21648 54.04644
[9] 56.02792 60.62312 54.72357 59.11276 57.20782 57.16756 63.29984 55.37783
[17] 58.69361 53.13072 67.32274 55.82041
>
>
>
>
> 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] 194.7930 132.1596 191.4245 353.5795 227.4632 313.5791 190.4703 186.0983
[9] 292.9001 233.8421
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 194.7930 132.1596 191.4245 353.5795 227.4632 313.5791 190.4703 186.0983
[9] 292.9001 233.8421
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] -2.842171e-14 0.000000e+00 2.557954e-13 1.278977e-13 -2.842171e-14
[6] -5.684342e-14 0.000000e+00 1.705303e-13 5.684342e-14 -5.684342e-14
[11] 5.684342e-14 -1.136868e-13 2.842171e-14 1.421085e-14 1.989520e-13
[16] 5.684342e-14 0.000000e+00 1.705303e-13 -1.421085e-14 -8.526513e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
10 11
10 8
4 18
5 11
8 2
5 20
7 10
9 8
1 17
6 20
9 16
3 6
3 5
2 15
7 19
7 18
4 9
8 4
1 9
8 6
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 2.335767
> Min(tmp)
[1] -3.452361
> mean(tmp)
[1] -0.07786935
> Sum(tmp)
[1] -7.786935
> Var(tmp)
[1] 0.9717309
>
> rowMeans(tmp)
[1] -0.07786935
> rowSums(tmp)
[1] -7.786935
> rowVars(tmp)
[1] 0.9717309
> rowSd(tmp)
[1] 0.9857641
> rowMax(tmp)
[1] 2.335767
> rowMin(tmp)
[1] -3.452361
>
> colMeans(tmp)
[1] -1.089732264 1.591964858 0.324047640 -0.920039473 0.194424162
[6] -0.070224768 0.206599660 0.436689294 -0.269367095 0.997077093
[11] 0.094205718 0.197585548 1.769275946 -0.224099769 -0.641250268
[16] 0.243166289 0.794564435 0.574735992 0.087809062 -1.140005591
[21] 1.148591778 0.380926652 -0.376072704 1.001935661 -1.191058733
[26] -0.977721182 0.171601208 -0.513432995 0.196108568 -0.181520393
[31] 0.618320676 -0.744608482 -1.512300615 1.014969771 0.794843238
[36] -0.394306958 1.431999771 -1.857170025 0.719128190 1.720746508
[41] -1.554334629 -1.344014652 0.635051565 -1.323591609 -1.755523295
[46] -0.495591001 0.086648991 0.712958355 0.234621412 0.605515331
[51] -0.168912712 -0.713023171 -0.572999262 0.638969324 -1.860205693
[56] -0.125541710 -0.337153549 0.436379728 2.335767299 1.546663147
[61] -3.452360507 -0.379670823 0.990990928 -0.927640486 -0.391594096
[66] -1.526365743 -0.756566718 0.852431380 -1.278775980 -0.912087817
[71] -0.080557817 0.410562780 -0.791825651 0.057242579 -1.212955204
[76] 0.949023350 0.390906095 -1.091085145 0.487491948 -1.067343773
[81] -0.093695968 -0.089325029 0.995848639 -0.744901917 -0.136757857
[86] -0.470100415 0.912910050 0.450924875 -1.811945792 0.006727695
[91] 0.826735466 -0.327377455 -0.028964496 0.887664438 0.153772730
[96] -0.382392340 -1.628675289 -0.763150921 2.129494282 0.466365166
> colSums(tmp)
[1] -1.089732264 1.591964858 0.324047640 -0.920039473 0.194424162
[6] -0.070224768 0.206599660 0.436689294 -0.269367095 0.997077093
[11] 0.094205718 0.197585548 1.769275946 -0.224099769 -0.641250268
[16] 0.243166289 0.794564435 0.574735992 0.087809062 -1.140005591
[21] 1.148591778 0.380926652 -0.376072704 1.001935661 -1.191058733
[26] -0.977721182 0.171601208 -0.513432995 0.196108568 -0.181520393
[31] 0.618320676 -0.744608482 -1.512300615 1.014969771 0.794843238
[36] -0.394306958 1.431999771 -1.857170025 0.719128190 1.720746508
[41] -1.554334629 -1.344014652 0.635051565 -1.323591609 -1.755523295
[46] -0.495591001 0.086648991 0.712958355 0.234621412 0.605515331
[51] -0.168912712 -0.713023171 -0.572999262 0.638969324 -1.860205693
[56] -0.125541710 -0.337153549 0.436379728 2.335767299 1.546663147
[61] -3.452360507 -0.379670823 0.990990928 -0.927640486 -0.391594096
[66] -1.526365743 -0.756566718 0.852431380 -1.278775980 -0.912087817
[71] -0.080557817 0.410562780 -0.791825651 0.057242579 -1.212955204
[76] 0.949023350 0.390906095 -1.091085145 0.487491948 -1.067343773
[81] -0.093695968 -0.089325029 0.995848639 -0.744901917 -0.136757857
[86] -0.470100415 0.912910050 0.450924875 -1.811945792 0.006727695
[91] 0.826735466 -0.327377455 -0.028964496 0.887664438 0.153772730
[96] -0.382392340 -1.628675289 -0.763150921 2.129494282 0.466365166
> colVars(tmp)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
[1] -1.089732264 1.591964858 0.324047640 -0.920039473 0.194424162
[6] -0.070224768 0.206599660 0.436689294 -0.269367095 0.997077093
[11] 0.094205718 0.197585548 1.769275946 -0.224099769 -0.641250268
[16] 0.243166289 0.794564435 0.574735992 0.087809062 -1.140005591
[21] 1.148591778 0.380926652 -0.376072704 1.001935661 -1.191058733
[26] -0.977721182 0.171601208 -0.513432995 0.196108568 -0.181520393
[31] 0.618320676 -0.744608482 -1.512300615 1.014969771 0.794843238
[36] -0.394306958 1.431999771 -1.857170025 0.719128190 1.720746508
[41] -1.554334629 -1.344014652 0.635051565 -1.323591609 -1.755523295
[46] -0.495591001 0.086648991 0.712958355 0.234621412 0.605515331
[51] -0.168912712 -0.713023171 -0.572999262 0.638969324 -1.860205693
[56] -0.125541710 -0.337153549 0.436379728 2.335767299 1.546663147
[61] -3.452360507 -0.379670823 0.990990928 -0.927640486 -0.391594096
[66] -1.526365743 -0.756566718 0.852431380 -1.278775980 -0.912087817
[71] -0.080557817 0.410562780 -0.791825651 0.057242579 -1.212955204
[76] 0.949023350 0.390906095 -1.091085145 0.487491948 -1.067343773
[81] -0.093695968 -0.089325029 0.995848639 -0.744901917 -0.136757857
[86] -0.470100415 0.912910050 0.450924875 -1.811945792 0.006727695
[91] 0.826735466 -0.327377455 -0.028964496 0.887664438 0.153772730
[96] -0.382392340 -1.628675289 -0.763150921 2.129494282 0.466365166
> colMin(tmp)
[1] -1.089732264 1.591964858 0.324047640 -0.920039473 0.194424162
[6] -0.070224768 0.206599660 0.436689294 -0.269367095 0.997077093
[11] 0.094205718 0.197585548 1.769275946 -0.224099769 -0.641250268
[16] 0.243166289 0.794564435 0.574735992 0.087809062 -1.140005591
[21] 1.148591778 0.380926652 -0.376072704 1.001935661 -1.191058733
[26] -0.977721182 0.171601208 -0.513432995 0.196108568 -0.181520393
[31] 0.618320676 -0.744608482 -1.512300615 1.014969771 0.794843238
[36] -0.394306958 1.431999771 -1.857170025 0.719128190 1.720746508
[41] -1.554334629 -1.344014652 0.635051565 -1.323591609 -1.755523295
[46] -0.495591001 0.086648991 0.712958355 0.234621412 0.605515331
[51] -0.168912712 -0.713023171 -0.572999262 0.638969324 -1.860205693
[56] -0.125541710 -0.337153549 0.436379728 2.335767299 1.546663147
[61] -3.452360507 -0.379670823 0.990990928 -0.927640486 -0.391594096
[66] -1.526365743 -0.756566718 0.852431380 -1.278775980 -0.912087817
[71] -0.080557817 0.410562780 -0.791825651 0.057242579 -1.212955204
[76] 0.949023350 0.390906095 -1.091085145 0.487491948 -1.067343773
[81] -0.093695968 -0.089325029 0.995848639 -0.744901917 -0.136757857
[86] -0.470100415 0.912910050 0.450924875 -1.811945792 0.006727695
[91] 0.826735466 -0.327377455 -0.028964496 0.887664438 0.153772730
[96] -0.382392340 -1.628675289 -0.763150921 2.129494282 0.466365166
> colMedians(tmp)
[1] -1.089732264 1.591964858 0.324047640 -0.920039473 0.194424162
[6] -0.070224768 0.206599660 0.436689294 -0.269367095 0.997077093
[11] 0.094205718 0.197585548 1.769275946 -0.224099769 -0.641250268
[16] 0.243166289 0.794564435 0.574735992 0.087809062 -1.140005591
[21] 1.148591778 0.380926652 -0.376072704 1.001935661 -1.191058733
[26] -0.977721182 0.171601208 -0.513432995 0.196108568 -0.181520393
[31] 0.618320676 -0.744608482 -1.512300615 1.014969771 0.794843238
[36] -0.394306958 1.431999771 -1.857170025 0.719128190 1.720746508
[41] -1.554334629 -1.344014652 0.635051565 -1.323591609 -1.755523295
[46] -0.495591001 0.086648991 0.712958355 0.234621412 0.605515331
[51] -0.168912712 -0.713023171 -0.572999262 0.638969324 -1.860205693
[56] -0.125541710 -0.337153549 0.436379728 2.335767299 1.546663147
[61] -3.452360507 -0.379670823 0.990990928 -0.927640486 -0.391594096
[66] -1.526365743 -0.756566718 0.852431380 -1.278775980 -0.912087817
[71] -0.080557817 0.410562780 -0.791825651 0.057242579 -1.212955204
[76] 0.949023350 0.390906095 -1.091085145 0.487491948 -1.067343773
[81] -0.093695968 -0.089325029 0.995848639 -0.744901917 -0.136757857
[86] -0.470100415 0.912910050 0.450924875 -1.811945792 0.006727695
[91] 0.826735466 -0.327377455 -0.028964496 0.887664438 0.153772730
[96] -0.382392340 -1.628675289 -0.763150921 2.129494282 0.466365166
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -1.089732 1.591965 0.3240476 -0.9200395 0.1944242 -0.07022477 0.2065997
[2,] -1.089732 1.591965 0.3240476 -0.9200395 0.1944242 -0.07022477 0.2065997
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.4366893 -0.2693671 0.9970771 0.09420572 0.1975855 1.769276 -0.2240998
[2,] 0.4366893 -0.2693671 0.9970771 0.09420572 0.1975855 1.769276 -0.2240998
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.6412503 0.2431663 0.7945644 0.574736 0.08780906 -1.140006 1.148592
[2,] -0.6412503 0.2431663 0.7945644 0.574736 0.08780906 -1.140006 1.148592
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.3809267 -0.3760727 1.001936 -1.191059 -0.9777212 0.1716012 -0.513433
[2,] 0.3809267 -0.3760727 1.001936 -1.191059 -0.9777212 0.1716012 -0.513433
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.1961086 -0.1815204 0.6183207 -0.7446085 -1.512301 1.01497 0.7948432
[2,] 0.1961086 -0.1815204 0.6183207 -0.7446085 -1.512301 1.01497 0.7948432
[,36] [,37] [,38] [,39] [,40] [,41] [,42] [,43]
[1,] -0.394307 1.432 -1.85717 0.7191282 1.720747 -1.554335 -1.344015 0.6350516
[2,] -0.394307 1.432 -1.85717 0.7191282 1.720747 -1.554335 -1.344015 0.6350516
[,44] [,45] [,46] [,47] [,48] [,49] [,50]
[1,] -1.323592 -1.755523 -0.495591 0.08664899 0.7129584 0.2346214 0.6055153
[2,] -1.323592 -1.755523 -0.495591 0.08664899 0.7129584 0.2346214 0.6055153
[,51] [,52] [,53] [,54] [,55] [,56] [,57]
[1,] -0.1689127 -0.7130232 -0.5729993 0.6389693 -1.860206 -0.1255417 -0.3371535
[2,] -0.1689127 -0.7130232 -0.5729993 0.6389693 -1.860206 -0.1255417 -0.3371535
[,58] [,59] [,60] [,61] [,62] [,63] [,64]
[1,] 0.4363797 2.335767 1.546663 -3.452361 -0.3796708 0.9909909 -0.9276405
[2,] 0.4363797 2.335767 1.546663 -3.452361 -0.3796708 0.9909909 -0.9276405
[,65] [,66] [,67] [,68] [,69] [,70] [,71]
[1,] -0.3915941 -1.526366 -0.7565667 0.8524314 -1.278776 -0.9120878 -0.08055782
[2,] -0.3915941 -1.526366 -0.7565667 0.8524314 -1.278776 -0.9120878 -0.08055782
[,72] [,73] [,74] [,75] [,76] [,77] [,78]
[1,] 0.4105628 -0.7918257 0.05724258 -1.212955 0.9490233 0.3909061 -1.091085
[2,] 0.4105628 -0.7918257 0.05724258 -1.212955 0.9490233 0.3909061 -1.091085
[,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.4874919 -1.067344 -0.09369597 -0.08932503 0.9958486 -0.7449019
[2,] 0.4874919 -1.067344 -0.09369597 -0.08932503 0.9958486 -0.7449019
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.1367579 -0.4701004 0.91291 0.4509249 -1.811946 0.006727695 0.8267355
[2,] -0.1367579 -0.4701004 0.91291 0.4509249 -1.811946 0.006727695 0.8267355
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.3273775 -0.0289645 0.8876644 0.1537727 -0.3823923 -1.628675 -0.7631509
[2,] -0.3273775 -0.0289645 0.8876644 0.1537727 -0.3823923 -1.628675 -0.7631509
[,99] [,100]
[1,] 2.129494 0.4663652
[2,] 2.129494 0.4663652
>
>
> Max(tmp2)
[1] 2.084877
> Min(tmp2)
[1] -2.401677
> mean(tmp2)
[1] 0.1097595
> Sum(tmp2)
[1] 10.97595
> Var(tmp2)
[1] 1.073049
>
> rowMeans(tmp2)
[1] 0.777988601 0.586519006 -0.181568670 -1.458494339 0.734914530
[6] 0.620783906 -0.570328047 -1.052192191 0.781180640 -1.382122694
[11] 0.683095556 -1.530666769 0.080353242 -0.163231165 -0.336838722
[16] 0.054859341 -0.260281773 0.688305004 0.152263783 1.636937458
[21] 1.074609123 1.588741774 -0.327719785 1.567260068 1.335218494
[26] -0.701085021 1.011896351 1.033591687 0.606038746 -1.185643218
[31] 1.180627414 -0.871844337 0.234562383 -1.156415252 0.783672712
[36] -0.481003262 0.446539463 -2.349767346 -0.203517185 -1.462611785
[41] -0.064633723 0.861375890 1.068129672 1.801465078 -0.315587420
[46] -0.062728749 0.945733538 0.620622427 -0.140439040 -1.222752834
[51] -0.184807176 1.085840047 1.098114979 1.396535128 1.664646843
[56] 0.845877291 0.219052836 -0.734747583 0.778909962 1.350396207
[61] 1.821886748 0.311851973 0.431340957 1.136694285 -1.562734646
[66] 0.982815664 -1.575394130 -1.163840092 -2.401676886 -0.225191106
[71] -1.662972367 -0.057827381 -1.341684267 -0.114111312 -0.312296351
[76] 1.312654897 1.610090774 -0.489681425 1.721052049 -0.787599390
[81] 1.733269822 -1.262973531 0.412214130 0.293250447 -0.461802931
[86] -1.225257355 0.154451674 1.159217260 0.512180345 -0.628408332
[91] -0.272446581 0.518389725 -0.148026823 -0.012000446 2.084876773
[96] -1.379145532 1.036249730 -0.007994447 -1.452065427 -0.707038996
> rowSums(tmp2)
[1] 0.777988601 0.586519006 -0.181568670 -1.458494339 0.734914530
[6] 0.620783906 -0.570328047 -1.052192191 0.781180640 -1.382122694
[11] 0.683095556 -1.530666769 0.080353242 -0.163231165 -0.336838722
[16] 0.054859341 -0.260281773 0.688305004 0.152263783 1.636937458
[21] 1.074609123 1.588741774 -0.327719785 1.567260068 1.335218494
[26] -0.701085021 1.011896351 1.033591687 0.606038746 -1.185643218
[31] 1.180627414 -0.871844337 0.234562383 -1.156415252 0.783672712
[36] -0.481003262 0.446539463 -2.349767346 -0.203517185 -1.462611785
[41] -0.064633723 0.861375890 1.068129672 1.801465078 -0.315587420
[46] -0.062728749 0.945733538 0.620622427 -0.140439040 -1.222752834
[51] -0.184807176 1.085840047 1.098114979 1.396535128 1.664646843
[56] 0.845877291 0.219052836 -0.734747583 0.778909962 1.350396207
[61] 1.821886748 0.311851973 0.431340957 1.136694285 -1.562734646
[66] 0.982815664 -1.575394130 -1.163840092 -2.401676886 -0.225191106
[71] -1.662972367 -0.057827381 -1.341684267 -0.114111312 -0.312296351
[76] 1.312654897 1.610090774 -0.489681425 1.721052049 -0.787599390
[81] 1.733269822 -1.262973531 0.412214130 0.293250447 -0.461802931
[86] -1.225257355 0.154451674 1.159217260 0.512180345 -0.628408332
[91] -0.272446581 0.518389725 -0.148026823 -0.012000446 2.084876773
[96] -1.379145532 1.036249730 -0.007994447 -1.452065427 -0.707038996
> 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.777988601 0.586519006 -0.181568670 -1.458494339 0.734914530
[6] 0.620783906 -0.570328047 -1.052192191 0.781180640 -1.382122694
[11] 0.683095556 -1.530666769 0.080353242 -0.163231165 -0.336838722
[16] 0.054859341 -0.260281773 0.688305004 0.152263783 1.636937458
[21] 1.074609123 1.588741774 -0.327719785 1.567260068 1.335218494
[26] -0.701085021 1.011896351 1.033591687 0.606038746 -1.185643218
[31] 1.180627414 -0.871844337 0.234562383 -1.156415252 0.783672712
[36] -0.481003262 0.446539463 -2.349767346 -0.203517185 -1.462611785
[41] -0.064633723 0.861375890 1.068129672 1.801465078 -0.315587420
[46] -0.062728749 0.945733538 0.620622427 -0.140439040 -1.222752834
[51] -0.184807176 1.085840047 1.098114979 1.396535128 1.664646843
[56] 0.845877291 0.219052836 -0.734747583 0.778909962 1.350396207
[61] 1.821886748 0.311851973 0.431340957 1.136694285 -1.562734646
[66] 0.982815664 -1.575394130 -1.163840092 -2.401676886 -0.225191106
[71] -1.662972367 -0.057827381 -1.341684267 -0.114111312 -0.312296351
[76] 1.312654897 1.610090774 -0.489681425 1.721052049 -0.787599390
[81] 1.733269822 -1.262973531 0.412214130 0.293250447 -0.461802931
[86] -1.225257355 0.154451674 1.159217260 0.512180345 -0.628408332
[91] -0.272446581 0.518389725 -0.148026823 -0.012000446 2.084876773
[96] -1.379145532 1.036249730 -0.007994447 -1.452065427 -0.707038996
> rowMin(tmp2)
[1] 0.777988601 0.586519006 -0.181568670 -1.458494339 0.734914530
[6] 0.620783906 -0.570328047 -1.052192191 0.781180640 -1.382122694
[11] 0.683095556 -1.530666769 0.080353242 -0.163231165 -0.336838722
[16] 0.054859341 -0.260281773 0.688305004 0.152263783 1.636937458
[21] 1.074609123 1.588741774 -0.327719785 1.567260068 1.335218494
[26] -0.701085021 1.011896351 1.033591687 0.606038746 -1.185643218
[31] 1.180627414 -0.871844337 0.234562383 -1.156415252 0.783672712
[36] -0.481003262 0.446539463 -2.349767346 -0.203517185 -1.462611785
[41] -0.064633723 0.861375890 1.068129672 1.801465078 -0.315587420
[46] -0.062728749 0.945733538 0.620622427 -0.140439040 -1.222752834
[51] -0.184807176 1.085840047 1.098114979 1.396535128 1.664646843
[56] 0.845877291 0.219052836 -0.734747583 0.778909962 1.350396207
[61] 1.821886748 0.311851973 0.431340957 1.136694285 -1.562734646
[66] 0.982815664 -1.575394130 -1.163840092 -2.401676886 -0.225191106
[71] -1.662972367 -0.057827381 -1.341684267 -0.114111312 -0.312296351
[76] 1.312654897 1.610090774 -0.489681425 1.721052049 -0.787599390
[81] 1.733269822 -1.262973531 0.412214130 0.293250447 -0.461802931
[86] -1.225257355 0.154451674 1.159217260 0.512180345 -0.628408332
[91] -0.272446581 0.518389725 -0.148026823 -0.012000446 2.084876773
[96] -1.379145532 1.036249730 -0.007994447 -1.452065427 -0.707038996
>
> colMeans(tmp2)
[1] 0.1097595
> colSums(tmp2)
[1] 10.97595
> colVars(tmp2)
[1] 1.073049
> colSd(tmp2)
[1] 1.035881
> colMax(tmp2)
[1] 2.084877
> colMin(tmp2)
[1] -2.401677
> colMedians(tmp2)
[1] 0.1163085
> colRanges(tmp2)
[,1]
[1,] -2.401677
[2,] 2.084877
>
> 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] 7.9660152 0.3268163 -5.5945022 -4.4210523 -1.6651385 -2.7862143
[7] 3.9837384 1.8583020 1.7340935 3.6222918
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.1147130
[2,] 0.1732568
[3,] 0.7598699
[4,] 1.4780703
[5,] 2.7583485
>
> rowApply(tmp,sum)
[1] 2.95273646 -3.13840399 2.03435474 -0.04316453 1.69733103 -3.79363391
[7] 1.28299409 -0.34493250 -0.16129191 4.53836047
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 10 10 10 1 8 9 6 10 8 2
[2,] 8 3 3 7 4 4 7 7 1 9
[3,] 1 5 1 3 1 3 5 6 2 5
[4,] 3 1 6 2 10 5 2 1 7 1
[5,] 5 2 5 5 3 1 9 2 10 6
[6,] 2 4 4 6 5 7 1 3 6 8
[7,] 6 7 9 10 2 6 8 8 4 3
[8,] 7 8 8 4 9 2 4 4 3 10
[9,] 4 9 7 9 6 8 3 5 9 7
[10,] 9 6 2 8 7 10 10 9 5 4
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -2.4214045 -1.3811363 -4.6124253 -2.4248087 -1.4915636 0.5037661
[7] 1.9902660 -2.6578069 -2.1555515 -0.1443163 -1.0772420 3.8985028
[13] 2.0689177 -2.8059475 1.7998241 2.7389146 -0.9788018 0.5329747
[19] -4.0410239 2.4300794
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.4012162
[2,] -1.2039211
[3,] -1.1978167
[4,] 0.4472601
[5,] 0.9342894
>
> rowApply(tmp,sum)
[1] 2.1001910 -7.2929974 -0.1672464 -5.4165898 0.5478597
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 1 19 15 4 4
[2,] 2 12 6 19 6
[3,] 3 1 3 8 16
[4,] 5 4 12 5 14
[5,] 9 5 17 12 8
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -1.4012162 -1.36725349 -1.2829847 -0.90074656 -0.2933641 -0.7057258
[2,] 0.9342894 -0.04046765 -2.6142583 -1.53225004 -1.3412777 -0.3512371
[3,] 0.4472601 -0.65162114 -1.1816474 0.03028743 0.8488035 0.9071447
[4,] -1.2039211 1.48170370 -0.5783248 -0.81805593 -0.2076436 1.9368488
[5,] -1.1978167 -0.80349771 1.0447898 0.79595640 -0.4980818 -1.2832645
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 1.47124115 0.8958371 -0.5084313 0.4440986 -1.0741367 1.40596572
[2,] 0.05678782 -0.2416794 0.6518646 -0.9617209 -0.1650839 1.63627771
[3,] 0.31512453 -1.0873684 -1.2584760 -1.1821663 -0.5010545 0.02249918
[4,] 0.40577247 -0.3530215 -0.2669966 0.1800005 -0.7416876 -0.29015506
[5,] -0.25865997 -1.8715747 -0.7735121 1.3754719 1.4047207 1.12391523
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 1.806913618 -0.4341486 1.6769135 0.49661504 -0.07934687 0.21042693
[2,] 0.006360591 -0.3120201 -1.9876272 0.36584732 0.34795187 0.18088573
[3,] -0.070144394 -0.5321139 0.3663653 0.51577040 1.99037052 -0.06321911
[4,] -0.151391092 -0.6517228 0.8689764 -0.06258024 -1.37737862 -0.11812619
[5,] 0.477179006 -0.8759421 0.8751960 1.42326209 -1.86039871 0.32300738
[,19] [,20]
[1,] 0.01741013 1.7221235
[2,] -1.75754506 -0.1680950
[3,] -0.77025139 1.6871905
[4,] -2.14475242 -1.3241341
[5,] 0.61411484 0.5129946
>
>
> 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.23-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.23-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.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-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.3649939 -0.6113105 1.563583 -0.6830154 0.7952134 1.375183 0.7797511
col8 col9 col10 col11 col12 col13 col14
row1 -0.05558249 0.6663145 -0.2585957 0.1753164 -0.3486422 0.293529 -0.8445537
col15 col16 col17 col18 col19 col20
row1 -0.413292 0.7532955 -0.85057 -0.5406287 0.3008499 0.04835024
> tmp[,"col10"]
col10
row1 -0.2585957
row2 -1.0495055
row3 -0.2502088
row4 -0.7018498
row5 0.1493145
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -0.3649939 -0.6113105 1.5635832 -0.6830154 0.7952134 1.375183 0.7797511
row5 -1.6474181 -0.6733178 0.9398311 -1.5301315 -0.1880395 0.557130 -0.6133844
col8 col9 col10 col11 col12 col13 col14
row1 -0.05558249 0.6663145 -0.2585957 0.1753164 -0.3486422 0.293529 -0.8445537
row5 -0.14191869 1.3278165 0.1493145 -0.3237180 1.2444278 1.027816 0.5670085
col15 col16 col17 col18 col19 col20
row1 -0.413292 0.7532955 -0.850570 -0.5406287 0.3008499 0.04835024
row5 1.853218 0.5159055 -1.405814 0.9027639 0.3774627 -0.56498219
> tmp[,c("col6","col20")]
col6 col20
row1 1.3751826 0.04835024
row2 0.1614102 -0.75864875
row3 1.0524178 0.79888904
row4 -0.3335765 -0.36155517
row5 0.5571300 -0.56498219
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 1.375183 0.04835024
row5 0.557130 -0.56498219
>
>
>
>
> 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 51.30007 50.50101 50.44932 49.79255 49.74739 104.6752 49.33162 51.23745
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.80474 51.16285 50.64657 49.04633 50.15541 49.05375 49.66791 49.08103
col17 col18 col19 col20
row1 49.24656 49.00605 48.51218 106.0033
> tmp[,"col10"]
col10
row1 51.16285
row2 29.01280
row3 29.84773
row4 29.85495
row5 51.07229
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 51.30007 50.50101 50.44932 49.79255 49.74739 104.6752 49.33162 51.23745
row5 49.48245 50.21518 50.07804 49.97480 51.86500 103.9732 50.34351 49.83730
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.80474 51.16285 50.64657 49.04633 50.15541 49.05375 49.66791 49.08103
row5 48.96401 51.07229 48.99556 51.64459 50.67598 50.94113 51.12591 49.67724
col17 col18 col19 col20
row1 49.24656 49.00605 48.51218 106.0033
row5 50.22438 49.12205 47.22128 104.9459
> tmp[,c("col6","col20")]
col6 col20
row1 104.67515 106.00328
row2 73.12576 74.99293
row3 74.61347 74.77749
row4 76.52814 74.03199
row5 103.97315 104.94587
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.6752 106.0033
row5 103.9732 104.9459
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.6752 106.0033
row5 103.9732 104.9459
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 1.04377254
[2,] -1.38058145
[3,] 0.04330894
[4,] 0.16110964
[5,] -0.16067473
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.3473713 0.8491934
[2,] 0.5314346 -0.3945443
[3,] 0.7290428 -1.0536658
[4,] -1.2509554 0.3463301
[5,] 1.2795246 0.9082619
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.8854651 -0.48284063
[2,] -0.2806396 0.91428168
[3,] 0.2938257 -0.91599666
[4,] 0.8115817 0.04767322
[5,] 0.8901668 1.75544675
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.8854651
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.8854651
[2,] -0.2806396
>
>
>
> 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.4190291 -0.6301577 0.8944664 0.9066462 1.079206 0.6436994 -0.7785247
row1 -0.3735331 -0.3605699 -0.2439263 -1.1358013 2.168436 0.0947319 -0.8949494
[,8] [,9] [,10] [,11] [,12] [,13]
row3 2.09664709 -0.9292926 0.06547189 -0.06339564 -0.07539431 -0.7636229
row1 0.08626485 -0.1259727 -0.02830020 -2.33880211 -0.12816180 -0.1922766
[,14] [,15] [,16] [,17] [,18] [,19]
row3 -0.3929171 2.2277955 1.128066 -0.4732698 -0.001271453 0.9636688
row1 -1.4442373 0.9943547 -1.103443 -1.1056206 -0.714515619 2.1603400
[,20]
row3 -0.91542011
row1 0.01419508
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.4224281 0.9927113 -0.6505263 -0.08323616 -0.452631 0.2699425 -0.7447723
[,8] [,9] [,10]
row2 0.4715143 0.1991198 -1.845888
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.1346352 -0.1316904 -1.862528 -0.4370906 0.458796 0.2078168 -0.3245738
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -2.356151 -1.083476 -0.8161208 -0.3689175 2.033488 -2.123046 0.4540281
[,15] [,16] [,17] [,18] [,19] [,20]
row5 2.216139 -1.029866 0.897108 -0.8451748 -1.012217 0.3348757
>
>
> 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: 0x6385505e2810>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1814a22f22b8a4"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1814a25d9a2880"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1814a211ef1678"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1814a22e3d59b"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1814a226fa01f4"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1814a25489e44a"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1814a214c86862"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1814a26ea557fd"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1814a21a43a65c"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1814a22966fdd2"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1814a23348c0ff"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1814a26f3934a3"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1814a23e93fdb6"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1814a22d68312b"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1814a261791288"
>
>
> ### 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: 0x638551b05440>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x638551b05440>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x638551b05440>
> rowMedians(tmp)
[1] -0.0306515516 0.1873814868 -0.3234978473 0.0174988043 0.2722673954
[6] 0.0374177299 0.2522445203 -0.2714047443 0.3060403578 0.0329775523
[11] 0.0004009996 0.0112782699 0.3470202933 -0.2086471868 0.0251691412
[16] -0.2762074379 -0.1730752301 -0.1635934306 0.0951242806 -0.3246469311
[21] -0.0958226778 -0.1769402503 0.1004048438 0.0205821019 -0.1520977892
[26] -0.1343016780 -0.0453172763 -0.3873939561 -0.3714129139 -0.3702908708
[31] -0.2939121671 -0.4556274113 0.0338246555 0.1634265310 -0.0413634549
[36] -0.0937838103 -0.1312745549 0.0086477595 0.1951792686 -0.4284132393
[41] 0.0950362031 -0.2256600622 -0.1655530793 -0.4556540726 -0.4757428638
[46] 0.0379620681 0.5479141178 0.1157306234 0.1641510570 -0.3497604983
[51] 0.0380123600 -0.5264045997 -0.9680853692 0.2463920865 -0.1169649303
[56] 0.0062920494 0.1421062298 -0.1803066486 -0.0984899637 -0.7859259265
[61] 0.1831658467 0.4080518967 -0.2333096809 0.0852767154 -0.3459300796
[66] -0.0988544134 0.1962803242 0.0263716742 0.4268098404 -0.1586569130
[71] 0.2556382520 -0.0261754594 -0.2815427278 -0.5070562602 -0.0042451280
[76] 0.0791507391 -0.0540576896 -0.0780628747 0.4070711878 0.3457476784
[81] -0.2558417138 -0.6141646122 -0.2233869965 -0.0340516227 0.1926669217
[86] -0.0844376932 -0.3525582323 0.1378017618 0.3636868546 -0.1252722658
[91] 0.1949901426 0.3166999608 -0.4356524281 0.2460515697 0.3112448682
[96] 0.1934373274 0.1628022805 0.3065750826 -0.0109397636 0.0785497163
[101] -0.1905103605 -0.1781698568 0.0108667216 -0.0127223097 -0.2771559734
[106] -0.1810260825 0.0042376581 -0.3148406582 -0.2357354027 -0.4344522118
[111] 0.1571493797 -0.1343083640 -0.4081984808 -0.1427098316 0.0483118486
[116] -0.5058089840 -0.3973900568 0.2892316410 -0.4129478064 -0.1819980505
[121] 0.1005145483 0.2198010770 -0.2593739004 -0.0009159969 0.5527697953
[126] -0.2655913368 -0.1152661044 -0.0848525866 -0.0181046501 0.1667999324
[131] -0.2003351123 0.0301536777 -0.4940103998 -0.0387453603 0.1015265336
[136] -0.7471928046 -0.3315055812 -0.1543781436 -0.0236767320 0.0071325604
[141] 0.0692089905 0.0407528365 0.3654050544 -0.1405073987 0.4261885015
[146] 0.1416656155 -0.0874963735 0.0971444827 -0.2355524241 0.1056260934
[151] -0.1331102385 -0.0450242312 0.1456301288 0.3881593285 0.1908901750
[156] 0.0713121042 -0.0552728514 0.0026561355 -0.1734153127 -0.2853696007
[161] 0.1342808837 0.0255147155 -0.3689829478 -0.3334155341 0.4834882923
[166] -0.0480724131 -0.0626373300 0.6258858148 -0.1491727543 0.0759536653
[171] -0.1741458651 -0.6186799527 -0.3380957216 -0.4129645608 0.0080162207
[176] -0.6105286635 -0.0580779442 0.2480124847 0.0122259405 0.3226176046
[181] -0.1307363663 -0.1437801118 0.3950986288 -0.2115179054 0.5380661091
[186] -0.0334033359 -0.2681041438 -0.5120396294 -0.1344157428 0.0909634218
[191] 0.4248308855 -0.1527528049 -0.4696320402 0.3461096997 -0.2226525390
[196] -0.0092751692 0.4463003378 0.0082043081 -0.1080057473 0.0202308152
[201] 0.2395293081 -0.3326252450 -0.3789726836 0.0261789811 0.4375370141
[206] 0.1199617047 -0.3184702986 -0.4347126812 0.2105021275 -0.3804072425
[211] -0.1403115216 0.2475710546 -0.1464001443 0.0927975645 -0.8248090996
[216] 0.1016271987 -0.0534188323 0.1153527354 0.4701232967 -0.2043276050
[221] 0.2816277701 -0.0775935487 -0.2675391377 0.2309386965 -0.3982411341
[226] -0.1485446613 -0.3670143392 0.0349587576 -0.0629222630 0.8433596947
>
> proc.time()
user system elapsed
1.316 1.465 2.770
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 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: 0x61679dc95c10>
> .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: 0x61679dc95c10>
> .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: 0x61679dc95c10>
> .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: 0x61679dc95c10>
> 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: 0x61679e9582d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x61679e9582d0>
> .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: 0x61679e9582d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x61679e9582d0>
> .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: 0x61679e9582d0>
> 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: 0x61679f02dd70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x61679f02dd70>
> .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: 0x61679f02dd70>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x61679f02dd70>
> .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: 0x61679f02dd70>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x61679f02dd70>
> .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: 0x61679f02dd70>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x61679f02dd70>
> .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: 0x61679f02dd70>
> 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: 0x61679eba1370>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x61679eba1370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x61679eba1370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x61679eba1370>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1816331ef8938b" "BufferedMatrixFile1816336b2df113"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1816331ef8938b" "BufferedMatrixFile1816336b2df113"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x61679eaecff0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x61679eaecff0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x61679eaecff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x61679eaecff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x61679eaecff0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x61679eaecff0>
> .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: 0x61679eccf3d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x61679eccf3d0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x61679eccf3d0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x61679eccf3d0>
> 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: 0x6167a0480fb0>
> .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: 0x6167a0480fb0>
> rm(P)
>
> proc.time()
user system elapsed
0.237 0.061 0.287
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 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.248 0.036 0.272