| Back to Build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-01-30 13:21 -0500 (Fri, 30 Jan 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" | 4852 |
| 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-01-29 21:47:13 -0500 (Thu, 29 Jan 2026) |
| EndedAt: 2026-01-29 21:47:38 -0500 (Thu, 29 Jan 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.239 0.058 0.285
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] "Thu Jan 29 21:47:28 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] "Thu Jan 29 21:47:28 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: 0x578908be2c10>
>
>
>
> 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] "Thu Jan 29 21:47:28 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] "Thu Jan 29 21:47:29 2026"
>
> ColMode(tmp2)
<pointer: 0x578908be2c10>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.9386411 -0.4743796 -0.9170668 0.86280817
[2,] 1.2422264 -0.9967112 1.2298403 0.64853878
[3,] 1.1768660 0.8286459 0.6431286 0.06583931
[4,] -0.4073163 0.2847033 0.1756988 1.47107697
> 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 : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.9386411 0.4743796 0.9170668 0.86280817
[2,] 1.2422264 0.9967112 1.2298403 0.64853878
[3,] 1.1768660 0.8286459 0.6431286 0.06583931
[4,] 0.4073163 0.2847033 0.1756988 1.47107697
> 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 : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0468224 0.6887522 0.9576360 0.9288747
[2,] 1.1145521 0.9983542 1.1089817 0.8053191
[3,] 1.0848346 0.9102999 0.8019530 0.2565917
[4,] 0.6382133 0.5335760 0.4191644 1.2128796
>
> 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 : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 226.40687 32.36190 35.49343 35.15155
[2,] 37.38775 35.98025 37.31966 33.70173
[3,] 37.02521 34.93165 33.66266 27.63176
[4,] 31.78945 30.62046 29.36734 38.59987
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x57890b477690>
> exp(tmp5)
<pointer: 0x57890b477690>
> log(tmp5,2)
<pointer: 0x57890b477690>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.2362
> Min(tmp5)
[1] 53.99462
> mean(tmp5)
[1] 72.92211
> Sum(tmp5)
[1] 14584.42
> Var(tmp5)
[1] 865.6216
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.70495 73.10323 68.85987 69.97675 73.41357 69.67303 71.07942 69.62789
[9] 70.48599 71.29640
> rowSums(tmp5)
[1] 1834.099 1462.065 1377.197 1399.535 1468.271 1393.461 1421.588 1392.558
[9] 1409.720 1425.928
> rowVars(tmp5)
[1] 8038.95299 68.81964 50.90357 68.29327 90.12212 86.20421
[7] 52.84586 62.28538 54.21028 60.31763
> rowSd(tmp5)
[1] 89.660209 8.295760 7.134674 8.263974 9.493267 9.284622 7.269516
[8] 7.892109 7.362763 7.766443
> rowMax(tmp5)
[1] 471.23623 87.96672 83.69525 85.79043 89.14830 85.70473 87.50215
[8] 89.26646 85.74042 85.18732
> rowMin(tmp5)
[1] 58.17560 56.74748 56.77598 55.61053 53.99462 56.18052 57.44772 54.10363
[9] 60.86389 58.35296
>
> colMeans(tmp5)
[1] 110.80393 69.82891 71.77086 70.47895 68.31683 71.50893 70.69534
[8] 68.98450 74.41451 69.15635 73.91282 71.57865 70.91080 69.27911
[15] 73.12426 73.46013 72.65536 69.39826 71.69554 66.46817
> colSums(tmp5)
[1] 1108.0393 698.2891 717.7086 704.7895 683.1683 715.0893 706.9534
[8] 689.8450 744.1451 691.5635 739.1282 715.7865 709.1080 692.7911
[15] 731.2426 734.6013 726.5536 693.9826 716.9554 664.6817
> colVars(tmp5)
[1] 16081.95944 69.66200 45.75152 64.18480 95.09320 147.29759
[7] 62.21744 18.63225 132.80490 60.63620 64.76401 97.53598
[13] 75.21970 26.27778 51.24916 54.15488 72.40770 70.64853
[19] 69.37071 15.48572
> colSd(tmp5)
[1] 126.814666 8.346376 6.763987 8.011542 9.751574 12.136622
[7] 7.887803 4.316509 11.524101 7.786925 8.047609 9.876030
[13] 8.672929 5.126185 7.158852 7.359000 8.509271 8.405268
[19] 8.328908 3.935190
> colMax(tmp5)
[1] 471.23623 85.18732 82.47359 82.87143 83.69525 89.91877 80.60752
[8] 74.20400 89.26646 82.16966 84.29282 85.59923 89.14830 78.04057
[15] 85.79043 82.34101 83.89390 87.96672 83.92822 72.41812
> colMin(tmp5)
[1] 59.78864 59.38097 61.12428 57.51188 56.74748 54.10363 56.77598 58.35296
[9] 55.61053 58.17560 57.87421 53.99462 57.23564 60.86389 65.97743 58.76250
[17] 56.18052 59.18802 61.69816 61.13314
>
>
> ### 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] 91.70495 73.10323 68.85987 69.97675 73.41357 69.67303 71.07942 NA
[9] 70.48599 71.29640
> rowSums(tmp5)
[1] 1834.099 1462.065 1377.197 1399.535 1468.271 1393.461 1421.588 NA
[9] 1409.720 1425.928
> rowVars(tmp5)
[1] 8038.95299 68.81964 50.90357 68.29327 90.12212 86.20421
[7] 52.84586 65.70180 54.21028 60.31763
> rowSd(tmp5)
[1] 89.660209 8.295760 7.134674 8.263974 9.493267 9.284622 7.269516
[8] 8.105664 7.362763 7.766443
> rowMax(tmp5)
[1] 471.23623 87.96672 83.69525 85.79043 89.14830 85.70473 87.50215
[8] NA 85.74042 85.18732
> rowMin(tmp5)
[1] 58.17560 56.74748 56.77598 55.61053 53.99462 56.18052 57.44772 NA
[9] 60.86389 58.35296
>
> colMeans(tmp5)
[1] 110.80393 69.82891 71.77086 70.47895 68.31683 71.50893 70.69534
[8] NA 74.41451 69.15635 73.91282 71.57865 70.91080 69.27911
[15] 73.12426 73.46013 72.65536 69.39826 71.69554 66.46817
> colSums(tmp5)
[1] 1108.0393 698.2891 717.7086 704.7895 683.1683 715.0893 706.9534
[8] NA 744.1451 691.5635 739.1282 715.7865 709.1080 692.7911
[15] 731.2426 734.6013 726.5536 693.9826 716.9554 664.6817
> colVars(tmp5)
[1] 16081.95944 69.66200 45.75152 64.18480 95.09320 147.29759
[7] 62.21744 NA 132.80490 60.63620 64.76401 97.53598
[13] 75.21970 26.27778 51.24916 54.15488 72.40770 70.64853
[19] 69.37071 15.48572
> colSd(tmp5)
[1] 126.814666 8.346376 6.763987 8.011542 9.751574 12.136622
[7] 7.887803 NA 11.524101 7.786925 8.047609 9.876030
[13] 8.672929 5.126185 7.158852 7.359000 8.509271 8.405268
[19] 8.328908 3.935190
> colMax(tmp5)
[1] 471.23623 85.18732 82.47359 82.87143 83.69525 89.91877 80.60752
[8] NA 89.26646 82.16966 84.29282 85.59923 89.14830 78.04057
[15] 85.79043 82.34101 83.89390 87.96672 83.92822 72.41812
> colMin(tmp5)
[1] 59.78864 59.38097 61.12428 57.51188 56.74748 54.10363 56.77598 NA
[9] 55.61053 58.17560 57.87421 53.99462 57.23564 60.86389 65.97743 58.76250
[17] 56.18052 59.18802 61.69816 61.13314
>
> Max(tmp5,na.rm=TRUE)
[1] 471.2362
> Min(tmp5,na.rm=TRUE)
[1] 53.99462
> mean(tmp5,na.rm=TRUE)
[1] 72.94302
> Sum(tmp5,na.rm=TRUE)
[1] 14515.66
> Var(tmp5,na.rm=TRUE)
[1] 869.9056
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.70495 73.10323 68.85987 69.97675 73.41357 69.67303 71.07942 69.67348
[9] 70.48599 71.29640
> rowSums(tmp5,na.rm=TRUE)
[1] 1834.099 1462.065 1377.197 1399.535 1468.271 1393.461 1421.588 1323.796
[9] 1409.720 1425.928
> rowVars(tmp5,na.rm=TRUE)
[1] 8038.95299 68.81964 50.90357 68.29327 90.12212 86.20421
[7] 52.84586 65.70180 54.21028 60.31763
> rowSd(tmp5,na.rm=TRUE)
[1] 89.660209 8.295760 7.134674 8.263974 9.493267 9.284622 7.269516
[8] 8.105664 7.362763 7.766443
> rowMax(tmp5,na.rm=TRUE)
[1] 471.23623 87.96672 83.69525 85.79043 89.14830 85.70473 87.50215
[8] 89.26646 85.74042 85.18732
> rowMin(tmp5,na.rm=TRUE)
[1] 58.17560 56.74748 56.77598 55.61053 53.99462 56.18052 57.44772 54.10363
[9] 60.86389 58.35296
>
> colMeans(tmp5,na.rm=TRUE)
[1] 110.80393 69.82891 71.77086 70.47895 68.31683 71.50893 70.69534
[8] 69.00927 74.41451 69.15635 73.91282 71.57865 70.91080 69.27911
[15] 73.12426 73.46013 72.65536 69.39826 71.69554 66.46817
> colSums(tmp5,na.rm=TRUE)
[1] 1108.0393 698.2891 717.7086 704.7895 683.1683 715.0893 706.9534
[8] 621.0834 744.1451 691.5635 739.1282 715.7865 709.1080 692.7911
[15] 731.2426 734.6013 726.5536 693.9826 716.9554 664.6817
> colVars(tmp5,na.rm=TRUE)
[1] 16081.95944 69.66200 45.75152 64.18480 95.09320 147.29759
[7] 62.21744 20.95438 132.80490 60.63620 64.76401 97.53598
[13] 75.21970 26.27778 51.24916 54.15488 72.40770 70.64853
[19] 69.37071 15.48572
> colSd(tmp5,na.rm=TRUE)
[1] 126.814666 8.346376 6.763987 8.011542 9.751574 12.136622
[7] 7.887803 4.577595 11.524101 7.786925 8.047609 9.876030
[13] 8.672929 5.126185 7.158852 7.359000 8.509271 8.405268
[19] 8.328908 3.935190
> colMax(tmp5,na.rm=TRUE)
[1] 471.23623 85.18732 82.47359 82.87143 83.69525 89.91877 80.60752
[8] 74.20400 89.26646 82.16966 84.29282 85.59923 89.14830 78.04057
[15] 85.79043 82.34101 83.89390 87.96672 83.92822 72.41812
> colMin(tmp5,na.rm=TRUE)
[1] 59.78864 59.38097 61.12428 57.51188 56.74748 54.10363 56.77598 58.35296
[9] 55.61053 58.17560 57.87421 53.99462 57.23564 60.86389 65.97743 58.76250
[17] 56.18052 59.18802 61.69816 61.13314
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.70495 73.10323 68.85987 69.97675 73.41357 69.67303 71.07942 NaN
[9] 70.48599 71.29640
> rowSums(tmp5,na.rm=TRUE)
[1] 1834.099 1462.065 1377.197 1399.535 1468.271 1393.461 1421.588 0.000
[9] 1409.720 1425.928
> rowVars(tmp5,na.rm=TRUE)
[1] 8038.95299 68.81964 50.90357 68.29327 90.12212 86.20421
[7] 52.84586 NA 54.21028 60.31763
> rowSd(tmp5,na.rm=TRUE)
[1] 89.660209 8.295760 7.134674 8.263974 9.493267 9.284622 7.269516
[8] NA 7.362763 7.766443
> rowMax(tmp5,na.rm=TRUE)
[1] 471.23623 87.96672 83.69525 85.79043 89.14830 85.70473 87.50215
[8] NA 85.74042 85.18732
> rowMin(tmp5,na.rm=TRUE)
[1] 58.17560 56.74748 56.77598 55.61053 53.99462 56.18052 57.44772 NA
[9] 60.86389 58.35296
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 115.72109 70.98979 72.11175 71.09631 68.06292 73.44285 70.47438
[8] NaN 72.76429 69.98667 73.59761 71.68570 70.90164 68.62954
[15] 73.51088 72.47336 72.95684 69.77881 71.50802 67.06095
> colSums(tmp5,na.rm=TRUE)
[1] 1041.4899 638.9081 649.0058 639.8668 612.5663 660.9856 634.2695
[8] 0.0000 654.8786 629.8800 662.3785 645.1713 638.1148 617.6658
[15] 661.5979 652.2603 656.6115 628.0093 643.5721 603.5486
> colVars(tmp5,na.rm=TRUE)
[1] 17820.19644 63.20871 50.16314 67.92014 106.25459 123.63417
[7] 69.44540 NA 118.76934 60.45954 71.74173 109.59907
[13] 84.62121 24.81565 55.97373 49.97006 80.43615 77.85034
[19] 77.64644 13.46829
> colSd(tmp5,na.rm=TRUE)
[1] 133.492309 7.950390 7.082594 8.241367 10.307987 11.119090
[7] 8.333391 NA 10.898135 7.775573 8.470049 10.468957
[13] 9.198979 4.981531 7.481560 7.068950 8.968620 8.823284
[19] 8.811722 3.669917
> colMax(tmp5,na.rm=TRUE)
[1] 471.23623 85.18732 82.47359 82.87143 83.69525 89.91877 80.60752
[8] -Inf 87.50215 82.16966 84.29282 85.59923 89.14830 78.04057
[15] 85.79043 82.06517 83.89390 87.96672 83.92822 72.41812
> colMin(tmp5,na.rm=TRUE)
[1] 59.78864 60.22770 61.12428 57.51188 56.74748 58.91920 56.77598 Inf
[9] 55.61053 58.17560 57.87421 53.99462 57.23564 60.86389 65.97743 58.76250
[17] 56.18052 59.18802 61.69816 61.58737
>
>
>
>
> 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] 219.8670 263.4989 337.2904 243.6090 135.0918 170.0583 314.9662 230.3058
[9] 359.4654 140.8932
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 219.8670 263.4989 337.2904 243.6090 135.0918 170.0583 314.9662 230.3058
[9] 359.4654 140.8932
>
>
>
> 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] 1.705303e-13 1.989520e-13 0.000000e+00 0.000000e+00 5.684342e-14
[6] -8.526513e-14 1.705303e-13 -5.684342e-14 1.563194e-13 0.000000e+00
[11] -2.842171e-13 -5.684342e-14 2.842171e-14 -2.842171e-14 0.000000e+00
[16] -5.684342e-14 2.842171e-14 -1.705303e-13 1.989520e-13 1.705303e-13
>
>
>
>
>
>
>
>
>
>
> ## 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)
+ }
4 14
3 5
6 16
10 9
5 14
8 2
2 19
2 20
4 14
1 20
2 18
4 15
2 8
5 2
3 10
4 17
2 2
8 19
7 9
2 12
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.548601
> Min(tmp)
[1] -2.432442
> mean(tmp)
[1] 0.05861582
> Sum(tmp)
[1] 5.861582
> Var(tmp)
[1] 0.9396788
>
> rowMeans(tmp)
[1] 0.05861582
> rowSums(tmp)
[1] 5.861582
> rowVars(tmp)
[1] 0.9396788
> rowSd(tmp)
[1] 0.9693703
> rowMax(tmp)
[1] 2.548601
> rowMin(tmp)
[1] -2.432442
>
> colMeans(tmp)
[1] -0.56380380 2.54860143 -0.16330405 -0.96204018 -0.11736814 -1.10022604
[7] 0.20599812 -1.25518502 0.81983451 -0.69122862 1.12904696 1.99868997
[13] 2.19199011 -0.46591902 -0.14866898 -2.43244228 -0.70743806 1.41803544
[19] 0.94217531 -0.71781313 -0.36875358 0.75234785 -0.32761127 0.03506011
[25] -0.27822465 -0.29660975 0.85867012 0.14818466 -0.89949861 -0.25242885
[31] -0.61032310 0.14085654 -1.79663675 -0.99966856 -1.04156090 -0.52734731
[37] 1.01612026 -1.29046587 1.55051061 -0.03512621 0.15985784 -0.05968257
[43] -0.04791536 -0.95524259 0.82573642 0.40720333 -0.53189380 1.15261430
[49] 1.20458263 0.20976502 1.76902310 0.88607462 0.99633865 0.38444893
[55] 1.94397703 -0.26489287 -0.13957367 -0.64157193 -1.66347449 -0.07318265
[61] -1.45507408 -0.09830890 -1.17708321 -0.04275483 -0.19223608 -0.09445955
[67] 0.78369903 -0.24121689 2.16051800 -0.24057041 -0.82801423 0.42017137
[73] -1.35472873 0.53154617 0.43333573 0.70819026 0.09477666 -0.78523391
[79] -0.07551737 1.45923693 0.61270426 0.51755486 1.39204429 0.08599671
[85] -0.69358263 1.61483956 -0.41056091 -0.50751484 0.79752658 0.89840046
[91] -0.74947348 0.90607489 -0.75267511 -0.87810099 -0.26305318 -1.12239073
[97] -0.63391950 1.82538006 -0.18593420 0.13336911
> colSums(tmp)
[1] -0.56380380 2.54860143 -0.16330405 -0.96204018 -0.11736814 -1.10022604
[7] 0.20599812 -1.25518502 0.81983451 -0.69122862 1.12904696 1.99868997
[13] 2.19199011 -0.46591902 -0.14866898 -2.43244228 -0.70743806 1.41803544
[19] 0.94217531 -0.71781313 -0.36875358 0.75234785 -0.32761127 0.03506011
[25] -0.27822465 -0.29660975 0.85867012 0.14818466 -0.89949861 -0.25242885
[31] -0.61032310 0.14085654 -1.79663675 -0.99966856 -1.04156090 -0.52734731
[37] 1.01612026 -1.29046587 1.55051061 -0.03512621 0.15985784 -0.05968257
[43] -0.04791536 -0.95524259 0.82573642 0.40720333 -0.53189380 1.15261430
[49] 1.20458263 0.20976502 1.76902310 0.88607462 0.99633865 0.38444893
[55] 1.94397703 -0.26489287 -0.13957367 -0.64157193 -1.66347449 -0.07318265
[61] -1.45507408 -0.09830890 -1.17708321 -0.04275483 -0.19223608 -0.09445955
[67] 0.78369903 -0.24121689 2.16051800 -0.24057041 -0.82801423 0.42017137
[73] -1.35472873 0.53154617 0.43333573 0.70819026 0.09477666 -0.78523391
[79] -0.07551737 1.45923693 0.61270426 0.51755486 1.39204429 0.08599671
[85] -0.69358263 1.61483956 -0.41056091 -0.50751484 0.79752658 0.89840046
[91] -0.74947348 0.90607489 -0.75267511 -0.87810099 -0.26305318 -1.12239073
[97] -0.63391950 1.82538006 -0.18593420 0.13336911
> 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.56380380 2.54860143 -0.16330405 -0.96204018 -0.11736814 -1.10022604
[7] 0.20599812 -1.25518502 0.81983451 -0.69122862 1.12904696 1.99868997
[13] 2.19199011 -0.46591902 -0.14866898 -2.43244228 -0.70743806 1.41803544
[19] 0.94217531 -0.71781313 -0.36875358 0.75234785 -0.32761127 0.03506011
[25] -0.27822465 -0.29660975 0.85867012 0.14818466 -0.89949861 -0.25242885
[31] -0.61032310 0.14085654 -1.79663675 -0.99966856 -1.04156090 -0.52734731
[37] 1.01612026 -1.29046587 1.55051061 -0.03512621 0.15985784 -0.05968257
[43] -0.04791536 -0.95524259 0.82573642 0.40720333 -0.53189380 1.15261430
[49] 1.20458263 0.20976502 1.76902310 0.88607462 0.99633865 0.38444893
[55] 1.94397703 -0.26489287 -0.13957367 -0.64157193 -1.66347449 -0.07318265
[61] -1.45507408 -0.09830890 -1.17708321 -0.04275483 -0.19223608 -0.09445955
[67] 0.78369903 -0.24121689 2.16051800 -0.24057041 -0.82801423 0.42017137
[73] -1.35472873 0.53154617 0.43333573 0.70819026 0.09477666 -0.78523391
[79] -0.07551737 1.45923693 0.61270426 0.51755486 1.39204429 0.08599671
[85] -0.69358263 1.61483956 -0.41056091 -0.50751484 0.79752658 0.89840046
[91] -0.74947348 0.90607489 -0.75267511 -0.87810099 -0.26305318 -1.12239073
[97] -0.63391950 1.82538006 -0.18593420 0.13336911
> colMin(tmp)
[1] -0.56380380 2.54860143 -0.16330405 -0.96204018 -0.11736814 -1.10022604
[7] 0.20599812 -1.25518502 0.81983451 -0.69122862 1.12904696 1.99868997
[13] 2.19199011 -0.46591902 -0.14866898 -2.43244228 -0.70743806 1.41803544
[19] 0.94217531 -0.71781313 -0.36875358 0.75234785 -0.32761127 0.03506011
[25] -0.27822465 -0.29660975 0.85867012 0.14818466 -0.89949861 -0.25242885
[31] -0.61032310 0.14085654 -1.79663675 -0.99966856 -1.04156090 -0.52734731
[37] 1.01612026 -1.29046587 1.55051061 -0.03512621 0.15985784 -0.05968257
[43] -0.04791536 -0.95524259 0.82573642 0.40720333 -0.53189380 1.15261430
[49] 1.20458263 0.20976502 1.76902310 0.88607462 0.99633865 0.38444893
[55] 1.94397703 -0.26489287 -0.13957367 -0.64157193 -1.66347449 -0.07318265
[61] -1.45507408 -0.09830890 -1.17708321 -0.04275483 -0.19223608 -0.09445955
[67] 0.78369903 -0.24121689 2.16051800 -0.24057041 -0.82801423 0.42017137
[73] -1.35472873 0.53154617 0.43333573 0.70819026 0.09477666 -0.78523391
[79] -0.07551737 1.45923693 0.61270426 0.51755486 1.39204429 0.08599671
[85] -0.69358263 1.61483956 -0.41056091 -0.50751484 0.79752658 0.89840046
[91] -0.74947348 0.90607489 -0.75267511 -0.87810099 -0.26305318 -1.12239073
[97] -0.63391950 1.82538006 -0.18593420 0.13336911
> colMedians(tmp)
[1] -0.56380380 2.54860143 -0.16330405 -0.96204018 -0.11736814 -1.10022604
[7] 0.20599812 -1.25518502 0.81983451 -0.69122862 1.12904696 1.99868997
[13] 2.19199011 -0.46591902 -0.14866898 -2.43244228 -0.70743806 1.41803544
[19] 0.94217531 -0.71781313 -0.36875358 0.75234785 -0.32761127 0.03506011
[25] -0.27822465 -0.29660975 0.85867012 0.14818466 -0.89949861 -0.25242885
[31] -0.61032310 0.14085654 -1.79663675 -0.99966856 -1.04156090 -0.52734731
[37] 1.01612026 -1.29046587 1.55051061 -0.03512621 0.15985784 -0.05968257
[43] -0.04791536 -0.95524259 0.82573642 0.40720333 -0.53189380 1.15261430
[49] 1.20458263 0.20976502 1.76902310 0.88607462 0.99633865 0.38444893
[55] 1.94397703 -0.26489287 -0.13957367 -0.64157193 -1.66347449 -0.07318265
[61] -1.45507408 -0.09830890 -1.17708321 -0.04275483 -0.19223608 -0.09445955
[67] 0.78369903 -0.24121689 2.16051800 -0.24057041 -0.82801423 0.42017137
[73] -1.35472873 0.53154617 0.43333573 0.70819026 0.09477666 -0.78523391
[79] -0.07551737 1.45923693 0.61270426 0.51755486 1.39204429 0.08599671
[85] -0.69358263 1.61483956 -0.41056091 -0.50751484 0.79752658 0.89840046
[91] -0.74947348 0.90607489 -0.75267511 -0.87810099 -0.26305318 -1.12239073
[97] -0.63391950 1.82538006 -0.18593420 0.13336911
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.5638038 2.548601 -0.1633041 -0.9620402 -0.1173681 -1.100226 0.2059981
[2,] -0.5638038 2.548601 -0.1633041 -0.9620402 -0.1173681 -1.100226 0.2059981
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -1.255185 0.8198345 -0.6912286 1.129047 1.99869 2.19199 -0.465919
[2,] -1.255185 0.8198345 -0.6912286 1.129047 1.99869 2.19199 -0.465919
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.148669 -2.432442 -0.7074381 1.418035 0.9421753 -0.7178131 -0.3687536
[2,] -0.148669 -2.432442 -0.7074381 1.418035 0.9421753 -0.7178131 -0.3687536
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.7523479 -0.3276113 0.03506011 -0.2782247 -0.2966097 0.8586701 0.1481847
[2,] 0.7523479 -0.3276113 0.03506011 -0.2782247 -0.2966097 0.8586701 0.1481847
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.8994986 -0.2524288 -0.6103231 0.1408565 -1.796637 -0.9996686 -1.041561
[2,] -0.8994986 -0.2524288 -0.6103231 0.1408565 -1.796637 -0.9996686 -1.041561
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.5273473 1.01612 -1.290466 1.550511 -0.03512621 0.1598578 -0.05968257
[2,] -0.5273473 1.01612 -1.290466 1.550511 -0.03512621 0.1598578 -0.05968257
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.04791536 -0.9552426 0.8257364 0.4072033 -0.5318938 1.152614 1.204583
[2,] -0.04791536 -0.9552426 0.8257364 0.4072033 -0.5318938 1.152614 1.204583
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.209765 1.769023 0.8860746 0.9963387 0.3844489 1.943977 -0.2648929
[2,] 0.209765 1.769023 0.8860746 0.9963387 0.3844489 1.943977 -0.2648929
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.1395737 -0.6415719 -1.663474 -0.07318265 -1.455074 -0.0983089 -1.177083
[2,] -0.1395737 -0.6415719 -1.663474 -0.07318265 -1.455074 -0.0983089 -1.177083
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.04275483 -0.1922361 -0.09445955 0.783699 -0.2412169 2.160518 -0.2405704
[2,] -0.04275483 -0.1922361 -0.09445955 0.783699 -0.2412169 2.160518 -0.2405704
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.8280142 0.4201714 -1.354729 0.5315462 0.4333357 0.7081903 0.09477666
[2,] -0.8280142 0.4201714 -1.354729 0.5315462 0.4333357 0.7081903 0.09477666
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.7852339 -0.07551737 1.459237 0.6127043 0.5175549 1.392044 0.08599671
[2,] -0.7852339 -0.07551737 1.459237 0.6127043 0.5175549 1.392044 0.08599671
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.6935826 1.61484 -0.4105609 -0.5075148 0.7975266 0.8984005 -0.7494735
[2,] -0.6935826 1.61484 -0.4105609 -0.5075148 0.7975266 0.8984005 -0.7494735
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 0.9060749 -0.7526751 -0.878101 -0.2630532 -1.122391 -0.6339195 1.82538
[2,] 0.9060749 -0.7526751 -0.878101 -0.2630532 -1.122391 -0.6339195 1.82538
[,99] [,100]
[1,] -0.1859342 0.1333691
[2,] -0.1859342 0.1333691
>
>
> Max(tmp2)
[1] 2.480421
> Min(tmp2)
[1] -1.70193
> mean(tmp2)
[1] 0.03860783
> Sum(tmp2)
[1] 3.860783
> Var(tmp2)
[1] 0.8460328
>
> rowMeans(tmp2)
[1] 0.728500076 0.703245783 -0.476333573 -1.506443614 -1.278739401
[6] -0.487507653 0.222471744 2.480420557 0.732535123 -1.701930043
[11] -0.343543559 0.380957489 -0.341931052 0.279960706 -1.100616331
[16] -0.259350729 0.365023766 -0.693692792 1.298475172 -0.974442344
[21] 2.015561680 0.794323831 0.365075963 -0.646909326 1.038753732
[26] -1.367941429 0.115907710 0.073079854 0.344167972 -0.183616696
[31] -0.391155362 0.353092678 0.234864648 -1.395926752 0.683887799
[36] -0.647823515 1.215324399 -0.936673179 -1.158436669 0.353137827
[41] 0.470161767 0.634764442 0.153616518 -0.092499419 -0.261104714
[46] 0.638541423 -1.408673898 0.212266532 -0.679961754 0.667322711
[51] 0.089379589 -0.348797899 0.108652799 0.479212042 -1.524198313
[56] -0.524272116 -0.216171848 1.040020278 0.771433627 0.711335956
[61] -0.360942820 1.475489279 0.275230043 1.493184291 0.281302628
[66] 1.730912494 1.399850150 -1.168397320 0.982262820 -1.244308697
[71] -1.171500590 2.199084937 -0.439877734 -0.084064302 -0.683940756
[76] -0.462197553 -0.009944403 0.016947059 -0.955685456 -1.367313353
[81] 1.027575220 1.024206003 1.354993501 -0.791361254 -0.063755061
[86] 0.645502682 0.411754620 -0.832609464 -0.871186336 -1.137335263
[91] 0.873194968 0.215545690 -1.352342990 1.909284133 0.929443757
[96] -0.127064149 -0.158500350 -0.471378103 -0.696865121 0.258807254
> rowSums(tmp2)
[1] 0.728500076 0.703245783 -0.476333573 -1.506443614 -1.278739401
[6] -0.487507653 0.222471744 2.480420557 0.732535123 -1.701930043
[11] -0.343543559 0.380957489 -0.341931052 0.279960706 -1.100616331
[16] -0.259350729 0.365023766 -0.693692792 1.298475172 -0.974442344
[21] 2.015561680 0.794323831 0.365075963 -0.646909326 1.038753732
[26] -1.367941429 0.115907710 0.073079854 0.344167972 -0.183616696
[31] -0.391155362 0.353092678 0.234864648 -1.395926752 0.683887799
[36] -0.647823515 1.215324399 -0.936673179 -1.158436669 0.353137827
[41] 0.470161767 0.634764442 0.153616518 -0.092499419 -0.261104714
[46] 0.638541423 -1.408673898 0.212266532 -0.679961754 0.667322711
[51] 0.089379589 -0.348797899 0.108652799 0.479212042 -1.524198313
[56] -0.524272116 -0.216171848 1.040020278 0.771433627 0.711335956
[61] -0.360942820 1.475489279 0.275230043 1.493184291 0.281302628
[66] 1.730912494 1.399850150 -1.168397320 0.982262820 -1.244308697
[71] -1.171500590 2.199084937 -0.439877734 -0.084064302 -0.683940756
[76] -0.462197553 -0.009944403 0.016947059 -0.955685456 -1.367313353
[81] 1.027575220 1.024206003 1.354993501 -0.791361254 -0.063755061
[86] 0.645502682 0.411754620 -0.832609464 -0.871186336 -1.137335263
[91] 0.873194968 0.215545690 -1.352342990 1.909284133 0.929443757
[96] -0.127064149 -0.158500350 -0.471378103 -0.696865121 0.258807254
> 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.728500076 0.703245783 -0.476333573 -1.506443614 -1.278739401
[6] -0.487507653 0.222471744 2.480420557 0.732535123 -1.701930043
[11] -0.343543559 0.380957489 -0.341931052 0.279960706 -1.100616331
[16] -0.259350729 0.365023766 -0.693692792 1.298475172 -0.974442344
[21] 2.015561680 0.794323831 0.365075963 -0.646909326 1.038753732
[26] -1.367941429 0.115907710 0.073079854 0.344167972 -0.183616696
[31] -0.391155362 0.353092678 0.234864648 -1.395926752 0.683887799
[36] -0.647823515 1.215324399 -0.936673179 -1.158436669 0.353137827
[41] 0.470161767 0.634764442 0.153616518 -0.092499419 -0.261104714
[46] 0.638541423 -1.408673898 0.212266532 -0.679961754 0.667322711
[51] 0.089379589 -0.348797899 0.108652799 0.479212042 -1.524198313
[56] -0.524272116 -0.216171848 1.040020278 0.771433627 0.711335956
[61] -0.360942820 1.475489279 0.275230043 1.493184291 0.281302628
[66] 1.730912494 1.399850150 -1.168397320 0.982262820 -1.244308697
[71] -1.171500590 2.199084937 -0.439877734 -0.084064302 -0.683940756
[76] -0.462197553 -0.009944403 0.016947059 -0.955685456 -1.367313353
[81] 1.027575220 1.024206003 1.354993501 -0.791361254 -0.063755061
[86] 0.645502682 0.411754620 -0.832609464 -0.871186336 -1.137335263
[91] 0.873194968 0.215545690 -1.352342990 1.909284133 0.929443757
[96] -0.127064149 -0.158500350 -0.471378103 -0.696865121 0.258807254
> rowMin(tmp2)
[1] 0.728500076 0.703245783 -0.476333573 -1.506443614 -1.278739401
[6] -0.487507653 0.222471744 2.480420557 0.732535123 -1.701930043
[11] -0.343543559 0.380957489 -0.341931052 0.279960706 -1.100616331
[16] -0.259350729 0.365023766 -0.693692792 1.298475172 -0.974442344
[21] 2.015561680 0.794323831 0.365075963 -0.646909326 1.038753732
[26] -1.367941429 0.115907710 0.073079854 0.344167972 -0.183616696
[31] -0.391155362 0.353092678 0.234864648 -1.395926752 0.683887799
[36] -0.647823515 1.215324399 -0.936673179 -1.158436669 0.353137827
[41] 0.470161767 0.634764442 0.153616518 -0.092499419 -0.261104714
[46] 0.638541423 -1.408673898 0.212266532 -0.679961754 0.667322711
[51] 0.089379589 -0.348797899 0.108652799 0.479212042 -1.524198313
[56] -0.524272116 -0.216171848 1.040020278 0.771433627 0.711335956
[61] -0.360942820 1.475489279 0.275230043 1.493184291 0.281302628
[66] 1.730912494 1.399850150 -1.168397320 0.982262820 -1.244308697
[71] -1.171500590 2.199084937 -0.439877734 -0.084064302 -0.683940756
[76] -0.462197553 -0.009944403 0.016947059 -0.955685456 -1.367313353
[81] 1.027575220 1.024206003 1.354993501 -0.791361254 -0.063755061
[86] 0.645502682 0.411754620 -0.832609464 -0.871186336 -1.137335263
[91] 0.873194968 0.215545690 -1.352342990 1.909284133 0.929443757
[96] -0.127064149 -0.158500350 -0.471378103 -0.696865121 0.258807254
>
> colMeans(tmp2)
[1] 0.03860783
> colSums(tmp2)
[1] 3.860783
> colVars(tmp2)
[1] 0.8460328
> colSd(tmp2)
[1] 0.9198004
> colMax(tmp2)
[1] 2.480421
> colMin(tmp2)
[1] -1.70193
> colMedians(tmp2)
[1] 0.08122972
> colRanges(tmp2)
[,1]
[1,] -1.701930
[2,] 2.480421
>
> 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] 1.6074287 0.3736857 -4.1199039 1.4823928 0.6024999 1.2993303
[7] 1.4744235 -2.9723775 7.2350989 -3.5498503
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.32435017
[2,] -0.16385933
[3,] -0.05154632
[4,] 0.41561434
[5,] 1.61387853
>
> rowApply(tmp,sum)
[1] 3.7325122 1.5880233 -2.8517548 1.9143431 -2.6496812 6.2960977
[7] -0.2963491 -5.0490312 -2.0351473 2.7837153
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 9 6 2 8 6 6 5 4 8 3
[2,] 5 8 10 9 5 4 1 6 4 4
[3,] 1 1 9 10 1 5 3 3 2 2
[4,] 6 2 8 6 8 1 9 9 6 8
[5,] 10 3 4 2 3 8 7 5 7 5
[6,] 3 10 3 5 10 3 8 10 5 6
[7,] 2 5 7 3 2 9 4 8 10 7
[8,] 4 9 1 4 7 7 6 7 1 1
[9,] 8 7 6 7 9 10 10 2 3 9
[10,] 7 4 5 1 4 2 2 1 9 10
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 1.1965844 -0.3487334 1.4171800 1.5386793 -3.7171943 -0.2251141
[7] -0.4432126 -2.2834388 0.8942319 1.9549831 2.4822402 -0.4731528
[13] 2.9635657 -2.4678596 0.4540523 5.8218268 1.3696743 -0.8953612
[19] -0.8342047 -1.9243774
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.61456881
[2,] 0.07432602
[3,] 0.19628467
[4,] 0.69649196
[5,] 0.84405059
>
> rowApply(tmp,sum)
[1] 0.5909577 1.3948685 6.1347061 -1.8342035 0.1940404
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 14 11 11
[2,] 12 2 18 12 2
[3,] 18 6 17 10 6
[4,] 15 4 20 5 13
[5,] 3 14 4 7 1
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.61456881 0.3028659 1.1274107 0.7234102 -0.9085688 1.2484271
[2,] 0.84405059 -1.1218247 -0.3351426 -0.9839323 0.4301057 1.0065211
[3,] 0.69649196 1.4470151 1.3039543 2.1477947 -0.8139892 -0.8834933
[4,] 0.07432602 0.0847628 -0.2305423 -0.7086961 -0.5896843 -1.9125073
[5,] 0.19628467 -1.0615526 -0.4485002 0.3601028 -1.8350576 0.3159383
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.8230277 -0.8860321 -0.003205457 0.9717345 -0.3417790 -0.5881271
[2,] -1.4769855 -0.9875557 0.816706927 0.0335829 0.2814600 -0.2441344
[3,] 0.7188537 -0.2978000 -0.095969143 1.1012515 0.6690613 0.2757233
[4,] 0.3535007 0.4222617 1.047171107 -0.9940047 1.3511552 -0.4026711
[5,] 0.7844462 -0.5343126 -0.870471518 0.8424189 0.5223427 0.4860566
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.1958988 -1.2263145 0.77383958 1.3628229 0.59393739 -1.0241699
[2,] 2.1028260 0.8550916 -0.01735546 1.7690486 -0.02826262 -0.2868187
[3,] 2.0861669 -0.6795765 -0.29350788 0.1538686 -0.83869288 -1.2095511
[4,] -0.6862496 -1.0729653 0.49525087 0.8443409 0.94023163 1.0183453
[5,] -0.3432788 -0.3440948 -0.50417478 1.6917457 0.70246080 0.6068332
[,19] [,20]
[1,] -0.48716654 0.5853683
[2,] -0.33437265 -0.9281403
[3,] 0.54099316 0.1061115
[4,] -0.45710244 -1.4111266
[5,] -0.09655627 -0.2765903
>
>
> 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 : 649 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 : 561 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.07694183 0.3568064 0.5167967 -1.27047 0.2735302 0.5879357 0.6096153
col8 col9 col10 col11 col12 col13 col14
row1 1.659218 -0.1261075 0.8388078 0.1341545 0.0302379 -0.5824029 1.37798
col15 col16 col17 col18 col19 col20
row1 -0.981791 1.796213 0.4254543 0.01261233 -1.661548 -1.251576
> tmp[,"col10"]
col10
row1 0.8388078
row2 0.9241023
row3 -0.5139252
row4 -1.4282663
row5 1.2594486
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -0.07694183 0.3568064 0.5167967 -1.270470 0.2735302 0.5879357 0.6096153
row5 -0.55426656 -0.3429816 0.1631870 -1.175348 0.1281508 -0.5349533 -1.5446956
col8 col9 col10 col11 col12 col13 col14
row1 1.6592176 -0.1261075 0.8388078 0.1341545 0.0302379 -0.5824029 1.3779800
row5 -0.2180937 -1.2035634 1.2594486 0.1214656 -0.1838956 -0.3237177 -0.3160507
col15 col16 col17 col18 col19 col20
row1 -0.9817910 1.79621300 0.4254543 0.01261233 -1.661548 -1.251576
row5 0.1771458 -0.02067224 -0.6426903 0.30539083 -1.589704 -1.202152
> tmp[,c("col6","col20")]
col6 col20
row1 0.58793566 -1.2515756
row2 -1.28163647 0.1387513
row3 0.01862688 -2.0750739
row4 0.08254322 -0.8873115
row5 -0.53495333 -1.2021517
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.5879357 -1.251576
row5 -0.5349533 -1.202152
>
>
>
>
> 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 49.08877 50.9422 48.19353 51.44346 50.00195 104.7796 52.78387 49.64679
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.98415 49.75802 49.40595 49.02027 52.00508 50.3801 49.53109 49.64708
col17 col18 col19 col20
row1 51.74067 49.86049 48.75591 106.0522
> tmp[,"col10"]
col10
row1 49.75802
row2 31.03225
row3 31.22558
row4 29.95343
row5 50.91915
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.08877 50.94220 48.19353 51.44346 50.00195 104.7796 52.78387 49.64679
row5 50.82082 50.41662 51.70354 50.54177 51.64321 105.8087 50.59070 48.90850
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.98415 49.75802 49.40595 49.02027 52.00508 50.38010 49.53109 49.64708
row5 51.72882 50.91915 50.61280 49.85693 50.43347 49.20955 50.16287 51.16784
col17 col18 col19 col20
row1 51.74067 49.86049 48.75591 106.0522
row5 50.54649 51.39482 50.24994 103.6706
> tmp[,c("col6","col20")]
col6 col20
row1 104.77960 106.05216
row2 75.77932 73.55294
row3 74.29423 74.10689
row4 76.21593 75.87636
row5 105.80875 103.67056
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.7796 106.0522
row5 105.8087 103.6706
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.7796 106.0522
row5 105.8087 103.6706
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.03103231
[2,] 0.06060243
[3,] -0.17681047
[4,] 1.48487243
[5,] 0.75914624
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.4728632 -0.7667326
[2,] 0.9596157 -1.1494678
[3,] -0.4392486 0.1479459
[4,] -0.6008606 3.1233336
[5,] 2.9401562 0.6231083
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.2834638 -0.96102792
[2,] 0.7237328 0.07299226
[3,] -0.7248906 1.03494264
[4,] 0.8261065 -2.16439228
[5,] 0.5763389 0.54976667
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.2834638
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.2834638
[2,] 0.7237328
>
>
>
> 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.08302986 1.5408796 0.2571048 -0.2282257 1.235903 0.2478689 -0.3689710
row1 -0.82147039 -0.5179468 0.2246180 -1.0288973 -1.161374 1.0276487 0.2982487
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 1.428573 1.514720 -1.9206261 -0.1895350 -2.272307 -0.4415205 0.005733126
row1 1.289017 1.330586 0.4064096 -0.1987244 -0.332309 -0.1509299 1.294872103
[,15] [,16] [,17] [,18] [,19] [,20]
row3 0.4669260 2.2477328 -0.1973266 -0.4366331 1.395735 0.2600155
row1 0.2136303 -0.1089876 -0.4044522 -1.2206662 0.103734 -0.8342495
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -1.076575 -0.8266889 -1.225301 1.004589 2.325731 -0.006209174 -0.3841865
[,8] [,9] [,10]
row2 -2.218093 -1.005021 -0.1698995
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.9912999 -0.4751346 -0.7373539 0.8062962 1.172372 0.716949 -0.248073
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.2968634 0.4538467 1.335518 0.455103 -1.797607 0.9839227 0.7859451
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.8254926 -1.400529 0.1241535 0.6743376 1.031135 0.4526205
>
>
> 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: 0x5789095d6290>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5505533c3b5bb"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM55055772aa50c"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM550551b0ac4fa"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5505517655fbd"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM550552412f4ad"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM550556a56d1c4"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM550557bc728b2"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM550551a05b7ff"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM550551861e321"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5505578af176a"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM55055fc8738f"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM55055631308e7"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM550551fd49cae"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM5505560fcf537"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM550552eb4917f"
>
>
> ### 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: 0x57890b2259e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x57890b2259e0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x57890b2259e0>
> rowMedians(tmp)
[1] -0.124980861 0.048599649 -0.004319835 0.161648996 0.240005160
[6] 0.048350029 -0.023014350 0.202565425 -0.312922525 -0.189772945
[11] 0.138008279 0.055413677 0.074678884 -0.023473394 -0.208792620
[16] -0.472292692 -0.195956837 -0.234319506 -0.225989442 -0.602232222
[21] 0.695216133 0.394414193 0.195202928 0.182664008 -0.525118794
[26] 0.632025545 0.808419842 0.144388008 -0.061364883 -0.262430712
[31] -0.136706376 0.001174592 -0.064416803 0.158354075 0.055199183
[36] -0.133948359 0.067228629 -0.100553223 0.500732339 0.343381913
[41] 0.482177469 0.223082023 0.527896325 0.036543616 -0.043573645
[46] 0.310241053 0.267044730 -0.112287815 0.410568711 0.203824657
[51] -0.437484504 0.179663281 -0.170480182 0.181746139 -0.591877441
[56] -0.403294642 0.029681418 -0.100648798 -0.124487080 0.018484473
[61] -0.077423616 0.097066289 -0.234887942 -0.109509729 0.234522212
[66] -0.102487106 -0.491168194 0.142020711 -0.075021768 -0.162472666
[71] -0.396190678 -0.039034532 0.403620844 -0.902696979 -0.653301281
[76] 0.216940234 0.163189196 0.405691300 0.242651252 -0.390164974
[81] -0.190140341 -0.214968748 0.150731152 0.019332682 0.152182482
[86] 0.053347481 0.053225985 -0.318013047 -0.270258280 -0.496004043
[91] 0.306230840 -0.216145431 0.034517234 0.538657711 0.354238832
[96] 0.493393911 -0.408436008 -0.301405343 -0.508680956 -0.240077108
[101] -0.041151933 0.007303478 0.201004449 0.175276607 0.106164125
[106] -0.077786623 -0.520739431 0.279211035 0.395310709 -0.202807551
[111] -0.153947192 -0.642105481 0.229102664 0.212956062 -0.208670442
[116] -0.208537348 0.460720675 -0.081423593 -0.857278771 0.275584361
[121] 0.077699702 0.184606981 -0.545382908 0.383718369 0.512529627
[126] -0.290723830 0.363367089 -0.003416333 0.233946363 -0.291044140
[131] 0.401617223 -0.202374073 -0.096508171 0.184824901 -0.069186024
[136] -0.229261202 0.314798764 0.862496188 0.026092882 0.004975156
[141] 0.093963923 0.050240798 -0.316056576 0.015884178 0.242125162
[146] 0.272102945 0.780001868 -0.496690105 0.433969051 0.316244925
[151] -0.144100866 0.011965618 0.294210692 -0.399811203 -0.111883522
[156] -0.464871536 0.530139749 0.192232102 -0.396279953 0.101651621
[161] 0.734279134 -0.372247284 0.364708238 -0.920208447 0.546439812
[166] 0.272581606 -0.277634922 -0.192286139 0.040505189 -0.655959483
[171] 0.055418832 -0.085800767 -0.152831249 0.518206563 -0.274292949
[176] -0.155280699 0.337889418 0.330423000 0.677362688 0.181486769
[181] -0.341096397 0.089790855 -0.018942788 -0.187701920 -0.050637250
[186] -0.026740488 -0.342995336 0.408588418 -0.079851831 0.228583727
[191] 0.413278750 -0.197796683 0.190669442 -0.224783487 -0.322541325
[196] 0.040985174 -0.229303738 0.075220751 -0.458904643 0.057716657
[201] 0.173739789 0.313936876 -0.005847216 -0.070974811 0.395918798
[206] 0.221544876 -0.130170119 0.123985990 -0.013753573 -0.171726149
[211] 0.118048406 -0.145001369 0.224661830 0.063428379 -0.427438386
[216] 0.001211816 0.266712537 0.049798428 -0.326710999 -0.304666548
[221] -0.352374342 -0.165227199 -0.173264629 -0.686779374 0.064483441
[226] 0.480060018 -0.071017634 0.721290113 0.197175493 -0.185994117
>
> proc.time()
user system elapsed
1.351 1.433 2.771
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: 0x58f949385c10>
> .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: 0x58f949385c10>
> .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: 0x58f949385c10>
> .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: 0x58f949385c10>
> 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: 0x58f94a0482d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x58f94a0482d0>
> .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: 0x58f94a0482d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x58f94a0482d0>
> .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: 0x58f94a0482d0>
> 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: 0x58f94a71dd70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x58f94a71dd70>
> .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: 0x58f94a71dd70>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x58f94a71dd70>
> .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: 0x58f94a71dd70>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x58f94a71dd70>
> .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: 0x58f94a71dd70>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x58f94a71dd70>
> .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: 0x58f94a71dd70>
> 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: 0x58f94a291370>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x58f94a291370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x58f94a291370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x58f94a291370>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile550fd6f311109" "BufferedMatrixFile550fdc6d1b5a"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile550fd6f311109" "BufferedMatrixFile550fdc6d1b5a"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x58f94a1dcff0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x58f94a1dcff0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x58f94a1dcff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x58f94a1dcff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x58f94a1dcff0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x58f94a1dcff0>
> .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: 0x58f94a3b55b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x58f94a3b55b0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x58f94a3b55b0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x58f94a3b55b0>
> 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: 0x58f94a192580>
> .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: 0x58f94a192580>
> rm(P)
>
> proc.time()
user system elapsed
0.250 0.056 0.291
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.247 0.041 0.275