| Back to Build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-02-06 11:32 -0500 (Fri, 06 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" | 4857 |
| 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-05 21:43:15 -0500 (Thu, 05 Feb 2026) |
| EndedAt: 2026-02-05 21:43:41 -0500 (Thu, 05 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.241 0.045 0.275
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 Feb 5 21:43:30 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 Feb 5 21:43:30 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: 0x5a4ee4dd8c10>
>
>
>
> 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 Feb 5 21:43:31 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 Feb 5 21:43:31 2026"
>
> ColMode(tmp2)
<pointer: 0x5a4ee4dd8c10>
>
>
>
> ### 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.291890 -0.7284350 -1.6465415 0.6551592
[2,] -0.398227 1.0725903 0.7485065 -0.3961952
[3,] -1.098072 0.4916403 1.5738830 0.3390623
[4,] -0.711058 -0.4818717 0.8741438 -1.2771479
> 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.291890 0.7284350 1.6465415 0.6551592
[2,] 0.398227 1.0725903 0.7485065 0.3961952
[3,] 1.098072 0.4916403 1.5738830 0.3390623
[4,] 0.711058 0.4818717 0.8741438 1.2771479
> 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.9645316 0.8534840 1.2831763 0.8094191
[2,] 0.6310523 1.0356594 0.8651627 0.6294404
[3,] 1.0478893 0.7011706 1.2545449 0.5822906
[4,] 0.8432426 0.6941698 0.9349566 1.1301097
>
> 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.93721 34.26328 39.47830 33.74935
[2,] 31.70875 36.42918 34.40013 31.69060
[3,] 36.57697 32.50335 39.11933 31.16197
[4,] 34.14348 32.42357 35.22371 37.57824
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5a4ee4f66cb0>
> exp(tmp5)
<pointer: 0x5a4ee4f66cb0>
> log(tmp5,2)
<pointer: 0x5a4ee4f66cb0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.096
> Min(tmp5)
[1] 54.042
> mean(tmp5)
[1] 72.73868
> Sum(tmp5)
[1] 14547.74
> Var(tmp5)
[1] 849.7932
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 95.82394 69.02600 70.15447 70.10172 68.30825 68.56748 69.00148 73.25981
[9] 71.87476 71.26895
> rowSums(tmp5)
[1] 1916.479 1380.520 1403.089 1402.034 1366.165 1371.350 1380.030 1465.196
[9] 1437.495 1425.379
> rowVars(tmp5)
[1] 7673.72219 51.63389 79.88371 102.16264 57.01639 63.98813
[7] 52.32308 39.57112 77.97425 55.33060
> rowSd(tmp5)
[1] 87.599784 7.185673 8.937769 10.107554 7.550920 7.999258 7.233469
[8] 6.290558 8.830303 7.438454
> rowMax(tmp5)
[1] 466.09595 84.50523 86.33734 90.03475 82.98168 81.66033 82.18641
[8] 83.70608 92.53770 87.97016
> rowMin(tmp5)
[1] 54.89833 54.81166 55.14614 54.04200 54.84925 54.56713 57.49750 55.39174
[9] 54.52166 56.75616
>
> colMeans(tmp5)
[1] 109.16414 70.11028 73.59851 67.92703 71.43678 67.77068 72.20746
[8] 68.44003 67.98828 74.27105 69.07453 76.60953 71.36060 71.15816
[15] 70.15689 70.48785 74.31637 72.99126 67.13085 68.57343
> colSums(tmp5)
[1] 1091.6414 701.1028 735.9851 679.2703 714.3678 677.7068 722.0746
[8] 684.4003 679.8828 742.7105 690.7453 766.0953 713.6060 711.5816
[15] 701.5689 704.8785 743.1637 729.9126 671.3085 685.7343
> colVars(tmp5)
[1] 15749.92888 33.02459 34.57757 100.60854 64.74044 47.06752
[7] 25.32099 112.60563 84.85327 70.05263 55.27053 25.50665
[13] 71.75728 58.61785 72.75654 66.71481 105.73891 150.01469
[19] 43.46939 124.40890
> colSd(tmp5)
[1] 125.498721 5.746702 5.880270 10.030381 8.046144 6.860577
[7] 5.031996 10.611580 9.211583 8.369745 7.434415 5.050410
[13] 8.470967 7.656230 8.529744 8.167913 10.282943 12.248048
[19] 6.593132 11.153874
> colMax(tmp5)
[1] 466.09595 81.89702 82.16892 81.77570 87.22963 75.54531 80.93958
[8] 85.84230 84.43056 86.33734 81.27861 84.50523 87.50513 81.62960
[15] 81.66033 85.35406 90.03475 90.38879 77.45782 92.53770
> colMin(tmp5)
[1] 61.89386 63.80170 63.85869 54.84925 61.98925 54.56713 64.45669 56.39320
[9] 58.93798 58.71841 54.05178 69.58037 55.14614 56.75616 54.04200 54.81166
[17] 54.52166 57.42144 55.39174 54.89833
>
>
> ### 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] NA 69.02600 70.15447 70.10172 68.30825 68.56748 69.00148 73.25981
[9] 71.87476 71.26895
> rowSums(tmp5)
[1] NA 1380.520 1403.089 1402.034 1366.165 1371.350 1380.030 1465.196
[9] 1437.495 1425.379
> rowVars(tmp5)
[1] 8089.13603 51.63389 79.88371 102.16264 57.01639 63.98813
[7] 52.32308 39.57112 77.97425 55.33060
> rowSd(tmp5)
[1] 89.939624 7.185673 8.937769 10.107554 7.550920 7.999258 7.233469
[8] 6.290558 8.830303 7.438454
> rowMax(tmp5)
[1] NA 84.50523 86.33734 90.03475 82.98168 81.66033 82.18641 83.70608
[9] 92.53770 87.97016
> rowMin(tmp5)
[1] NA 54.81166 55.14614 54.04200 54.84925 54.56713 57.49750 55.39174
[9] 54.52166 56.75616
>
> colMeans(tmp5)
[1] 109.16414 70.11028 NA 67.92703 71.43678 67.77068 72.20746
[8] 68.44003 67.98828 74.27105 69.07453 76.60953 71.36060 71.15816
[15] 70.15689 70.48785 74.31637 72.99126 67.13085 68.57343
> colSums(tmp5)
[1] 1091.6414 701.1028 NA 679.2703 714.3678 677.7068 722.0746
[8] 684.4003 679.8828 742.7105 690.7453 766.0953 713.6060 711.5816
[15] 701.5689 704.8785 743.1637 729.9126 671.3085 685.7343
> colVars(tmp5)
[1] 15749.92888 33.02459 NA 100.60854 64.74044 47.06752
[7] 25.32099 112.60563 84.85327 70.05263 55.27053 25.50665
[13] 71.75728 58.61785 72.75654 66.71481 105.73891 150.01469
[19] 43.46939 124.40890
> colSd(tmp5)
[1] 125.498721 5.746702 NA 10.030381 8.046144 6.860577
[7] 5.031996 10.611580 9.211583 8.369745 7.434415 5.050410
[13] 8.470967 7.656230 8.529744 8.167913 10.282943 12.248048
[19] 6.593132 11.153874
> colMax(tmp5)
[1] 466.09595 81.89702 NA 81.77570 87.22963 75.54531 80.93958
[8] 85.84230 84.43056 86.33734 81.27861 84.50523 87.50513 81.62960
[15] 81.66033 85.35406 90.03475 90.38879 77.45782 92.53770
> colMin(tmp5)
[1] 61.89386 63.80170 NA 54.84925 61.98925 54.56713 64.45669 56.39320
[9] 58.93798 58.71841 54.05178 69.58037 55.14614 56.75616 54.04200 54.81166
[17] 54.52166 57.42144 55.39174 54.89833
>
> Max(tmp5,na.rm=TRUE)
[1] 466.096
> Min(tmp5,na.rm=TRUE)
[1] 54.042
> mean(tmp5,na.rm=TRUE)
[1] 72.6913
> Sum(tmp5,na.rm=TRUE)
[1] 14465.57
> Var(tmp5,na.rm=TRUE)
[1] 853.6337
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 96.54262 69.02600 70.15447 70.10172 68.30825 68.56748 69.00148 73.25981
[9] 71.87476 71.26895
> rowSums(tmp5,na.rm=TRUE)
[1] 1834.310 1380.520 1403.089 1402.034 1366.165 1371.350 1380.030 1465.196
[9] 1437.495 1425.379
> rowVars(tmp5,na.rm=TRUE)
[1] 8089.13603 51.63389 79.88371 102.16264 57.01639 63.98813
[7] 52.32308 39.57112 77.97425 55.33060
> rowSd(tmp5,na.rm=TRUE)
[1] 89.939624 7.185673 8.937769 10.107554 7.550920 7.999258 7.233469
[8] 6.290558 8.830303 7.438454
> rowMax(tmp5,na.rm=TRUE)
[1] 466.09595 84.50523 86.33734 90.03475 82.98168 81.66033 82.18641
[8] 83.70608 92.53770 87.97016
> rowMin(tmp5,na.rm=TRUE)
[1] 54.89833 54.81166 55.14614 54.04200 54.84925 54.56713 57.49750 55.39174
[9] 54.52166 56.75616
>
> colMeans(tmp5,na.rm=TRUE)
[1] 109.16414 70.11028 72.64624 67.92703 71.43678 67.77068 72.20746
[8] 68.44003 67.98828 74.27105 69.07453 76.60953 71.36060 71.15816
[15] 70.15689 70.48785 74.31637 72.99126 67.13085 68.57343
> colSums(tmp5,na.rm=TRUE)
[1] 1091.6414 701.1028 653.8162 679.2703 714.3678 677.7068 722.0746
[8] 684.4003 679.8828 742.7105 690.7453 766.0953 713.6060 711.5816
[15] 701.5689 704.8785 743.1637 729.9126 671.3085 685.7343
> colVars(tmp5,na.rm=TRUE)
[1] 15749.92888 33.02459 28.69812 100.60854 64.74044 47.06752
[7] 25.32099 112.60563 84.85327 70.05263 55.27053 25.50665
[13] 71.75728 58.61785 72.75654 66.71481 105.73891 150.01469
[19] 43.46939 124.40890
> colSd(tmp5,na.rm=TRUE)
[1] 125.498721 5.746702 5.357063 10.030381 8.046144 6.860577
[7] 5.031996 10.611580 9.211583 8.369745 7.434415 5.050410
[13] 8.470967 7.656230 8.529744 8.167913 10.282943 12.248048
[19] 6.593132 11.153874
> colMax(tmp5,na.rm=TRUE)
[1] 466.09595 81.89702 81.42176 81.77570 87.22963 75.54531 80.93958
[8] 85.84230 84.43056 86.33734 81.27861 84.50523 87.50513 81.62960
[15] 81.66033 85.35406 90.03475 90.38879 77.45782 92.53770
> colMin(tmp5,na.rm=TRUE)
[1] 61.89386 63.80170 63.85869 54.84925 61.98925 54.56713 64.45669 56.39320
[9] 58.93798 58.71841 54.05178 69.58037 55.14614 56.75616 54.04200 54.81166
[17] 54.52166 57.42144 55.39174 54.89833
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] NaN 69.02600 70.15447 70.10172 68.30825 68.56748 69.00148 73.25981
[9] 71.87476 71.26895
> rowSums(tmp5,na.rm=TRUE)
[1] 0.000 1380.520 1403.089 1402.034 1366.165 1371.350 1380.030 1465.196
[9] 1437.495 1425.379
> rowVars(tmp5,na.rm=TRUE)
[1] NA 51.63389 79.88371 102.16264 57.01639 63.98813 52.32308
[8] 39.57112 77.97425 55.33060
> rowSd(tmp5,na.rm=TRUE)
[1] NA 7.185673 8.937769 10.107554 7.550920 7.999258 7.233469
[8] 6.290558 8.830303 7.438454
> rowMax(tmp5,na.rm=TRUE)
[1] NA 84.50523 86.33734 90.03475 82.98168 81.66033 82.18641 83.70608
[9] 92.53770 87.97016
> rowMin(tmp5,na.rm=TRUE)
[1] NA 54.81166 55.14614 54.04200 54.84925 54.56713 57.49750 55.39174
[9] 54.52166 56.75616
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 69.50505 69.97647 NaN 67.66949 69.68202 66.93838 71.23722 66.50645
[9] 66.16135 75.04284 68.87959 76.21158 69.56677 70.32153 69.87093 70.25040
[17] 75.40871 71.05820 66.44702 70.09289
> colSums(tmp5,na.rm=TRUE)
[1] 625.5455 629.7883 0.0000 609.0254 627.1382 602.4455 641.1350 598.5580
[9] 595.4522 675.3856 619.9163 685.9042 626.1009 632.8938 628.8383 632.2536
[17] 678.6784 639.5238 598.0231 630.8360
> colVars(tmp5,na.rm=TRUE)
[1] 24.18121 36.95124 NA 112.43846 38.19215 45.15798 17.89583
[8] 84.62039 57.91150 72.10796 61.75186 26.91337 44.52615 58.07067
[15] 80.93115 74.41986 105.53270 126.72847 43.64219 113.98661
> colSd(tmp5,na.rm=TRUE)
[1] 4.917439 6.078753 NA 10.603700 6.179980 6.719969 4.230347
[8] 9.198934 7.609960 8.491640 7.858235 5.187810 6.672792 7.620411
[15] 8.996174 8.626695 10.272911 11.257374 6.606224 10.676451
> colMax(tmp5,na.rm=TRUE)
[1] 76.13016 81.89702 -Inf 81.77570 81.90490 75.54531 78.06798 79.35593
[9] 83.70608 86.33734 81.27861 84.50523 77.76721 81.62960 81.66033 85.35406
[17] 90.03475 87.97016 77.45782 92.53770
> colMin(tmp5,na.rm=TRUE)
[1] 61.89386 63.80170 Inf 54.84925 61.98925 54.56713 64.45669 56.39320
[9] 58.93798 58.71841 54.05178 69.58037 55.14614 56.75616 54.04200 54.81166
[17] 54.52166 57.42144 55.39174 60.40097
>
>
>
>
> 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] 252.4557 112.4720 180.2886 288.9442 108.0530 157.7915 210.1883 401.9469
[9] 180.5311 224.4520
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 252.4557 112.4720 180.2886 288.9442 108.0530 157.7915 210.1883 401.9469
[9] 180.5311 224.4520
>
>
>
> 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] -4.263256e-14 7.105427e-14 2.842171e-14 -8.526513e-14 2.273737e-13
[6] -5.684342e-14 -1.421085e-14 -2.842171e-14 2.273737e-13 -2.842171e-14
[11] 2.842171e-14 2.273737e-13 -5.684342e-14 5.684342e-14 1.421085e-13
[16] -2.842171e-14 -8.526513e-14 -5.684342e-14 2.842171e-13 2.842171e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
1 17
7 3
5 2
6 14
8 20
1 15
10 17
10 18
4 4
2 14
7 1
1 1
3 1
4 12
5 18
6 2
1 18
1 8
2 14
6 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.672421
> Min(tmp)
[1] -2.486465
> mean(tmp)
[1] 0.1469528
> Sum(tmp)
[1] 14.69528
> Var(tmp)
[1] 0.8710002
>
> rowMeans(tmp)
[1] 0.1469528
> rowSums(tmp)
[1] 14.69528
> rowVars(tmp)
[1] 0.8710002
> rowSd(tmp)
[1] 0.9332739
> rowMax(tmp)
[1] 2.672421
> rowMin(tmp)
[1] -2.486465
>
> colMeans(tmp)
[1] -0.03715007 0.78632389 -1.90990822 1.26190163 2.01562057 -1.04045187
[7] -0.96314430 0.53949869 0.02880479 0.36924105 1.33095238 0.38906016
[13] -0.93678079 0.09437538 0.55615534 0.01684863 0.53596577 0.64183623
[19] 0.94271926 0.43125758 -0.72550278 -0.50091067 -0.60211623 -0.57361422
[25] 0.31138182 0.27323214 0.67151462 0.48757117 -2.04565174 0.10195608
[31] -1.12166591 -0.58694380 -0.13315554 0.14728744 0.72130290 0.63592314
[37] -1.88655182 -0.98247828 -0.37818821 0.34892882 1.10461006 -0.68748175
[43] 1.60365308 -1.23572772 -0.11772292 0.19308130 -0.30168802 -0.13594680
[49] -0.83201485 0.30558994 0.15608280 0.61266941 1.28138346 -0.31814919
[55] 0.42472296 0.31815199 -0.88931042 0.60099834 -0.19467157 0.90567207
[61] 0.67703635 -1.08694114 -1.24237918 0.12513875 2.67242149 -1.22787035
[67] 1.04970052 0.68369285 0.16312697 -0.52676508 -0.10399531 1.76276830
[73] -0.11856181 -0.22994249 0.47396046 -0.15748422 1.48022847 2.66588082
[79] 1.08695207 -0.28032231 1.28611661 -1.03095586 0.72033145 -0.40256046
[85] 0.65979056 -0.10060006 0.30044787 0.81644355 1.25600130 0.23580470
[91] -0.95227738 0.68957742 0.29990011 -0.15571449 0.34940087 0.25699770
[97] 0.45122892 1.86796710 -2.48646496 0.75785544
> colSums(tmp)
[1] -0.03715007 0.78632389 -1.90990822 1.26190163 2.01562057 -1.04045187
[7] -0.96314430 0.53949869 0.02880479 0.36924105 1.33095238 0.38906016
[13] -0.93678079 0.09437538 0.55615534 0.01684863 0.53596577 0.64183623
[19] 0.94271926 0.43125758 -0.72550278 -0.50091067 -0.60211623 -0.57361422
[25] 0.31138182 0.27323214 0.67151462 0.48757117 -2.04565174 0.10195608
[31] -1.12166591 -0.58694380 -0.13315554 0.14728744 0.72130290 0.63592314
[37] -1.88655182 -0.98247828 -0.37818821 0.34892882 1.10461006 -0.68748175
[43] 1.60365308 -1.23572772 -0.11772292 0.19308130 -0.30168802 -0.13594680
[49] -0.83201485 0.30558994 0.15608280 0.61266941 1.28138346 -0.31814919
[55] 0.42472296 0.31815199 -0.88931042 0.60099834 -0.19467157 0.90567207
[61] 0.67703635 -1.08694114 -1.24237918 0.12513875 2.67242149 -1.22787035
[67] 1.04970052 0.68369285 0.16312697 -0.52676508 -0.10399531 1.76276830
[73] -0.11856181 -0.22994249 0.47396046 -0.15748422 1.48022847 2.66588082
[79] 1.08695207 -0.28032231 1.28611661 -1.03095586 0.72033145 -0.40256046
[85] 0.65979056 -0.10060006 0.30044787 0.81644355 1.25600130 0.23580470
[91] -0.95227738 0.68957742 0.29990011 -0.15571449 0.34940087 0.25699770
[97] 0.45122892 1.86796710 -2.48646496 0.75785544
> 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.03715007 0.78632389 -1.90990822 1.26190163 2.01562057 -1.04045187
[7] -0.96314430 0.53949869 0.02880479 0.36924105 1.33095238 0.38906016
[13] -0.93678079 0.09437538 0.55615534 0.01684863 0.53596577 0.64183623
[19] 0.94271926 0.43125758 -0.72550278 -0.50091067 -0.60211623 -0.57361422
[25] 0.31138182 0.27323214 0.67151462 0.48757117 -2.04565174 0.10195608
[31] -1.12166591 -0.58694380 -0.13315554 0.14728744 0.72130290 0.63592314
[37] -1.88655182 -0.98247828 -0.37818821 0.34892882 1.10461006 -0.68748175
[43] 1.60365308 -1.23572772 -0.11772292 0.19308130 -0.30168802 -0.13594680
[49] -0.83201485 0.30558994 0.15608280 0.61266941 1.28138346 -0.31814919
[55] 0.42472296 0.31815199 -0.88931042 0.60099834 -0.19467157 0.90567207
[61] 0.67703635 -1.08694114 -1.24237918 0.12513875 2.67242149 -1.22787035
[67] 1.04970052 0.68369285 0.16312697 -0.52676508 -0.10399531 1.76276830
[73] -0.11856181 -0.22994249 0.47396046 -0.15748422 1.48022847 2.66588082
[79] 1.08695207 -0.28032231 1.28611661 -1.03095586 0.72033145 -0.40256046
[85] 0.65979056 -0.10060006 0.30044787 0.81644355 1.25600130 0.23580470
[91] -0.95227738 0.68957742 0.29990011 -0.15571449 0.34940087 0.25699770
[97] 0.45122892 1.86796710 -2.48646496 0.75785544
> colMin(tmp)
[1] -0.03715007 0.78632389 -1.90990822 1.26190163 2.01562057 -1.04045187
[7] -0.96314430 0.53949869 0.02880479 0.36924105 1.33095238 0.38906016
[13] -0.93678079 0.09437538 0.55615534 0.01684863 0.53596577 0.64183623
[19] 0.94271926 0.43125758 -0.72550278 -0.50091067 -0.60211623 -0.57361422
[25] 0.31138182 0.27323214 0.67151462 0.48757117 -2.04565174 0.10195608
[31] -1.12166591 -0.58694380 -0.13315554 0.14728744 0.72130290 0.63592314
[37] -1.88655182 -0.98247828 -0.37818821 0.34892882 1.10461006 -0.68748175
[43] 1.60365308 -1.23572772 -0.11772292 0.19308130 -0.30168802 -0.13594680
[49] -0.83201485 0.30558994 0.15608280 0.61266941 1.28138346 -0.31814919
[55] 0.42472296 0.31815199 -0.88931042 0.60099834 -0.19467157 0.90567207
[61] 0.67703635 -1.08694114 -1.24237918 0.12513875 2.67242149 -1.22787035
[67] 1.04970052 0.68369285 0.16312697 -0.52676508 -0.10399531 1.76276830
[73] -0.11856181 -0.22994249 0.47396046 -0.15748422 1.48022847 2.66588082
[79] 1.08695207 -0.28032231 1.28611661 -1.03095586 0.72033145 -0.40256046
[85] 0.65979056 -0.10060006 0.30044787 0.81644355 1.25600130 0.23580470
[91] -0.95227738 0.68957742 0.29990011 -0.15571449 0.34940087 0.25699770
[97] 0.45122892 1.86796710 -2.48646496 0.75785544
> colMedians(tmp)
[1] -0.03715007 0.78632389 -1.90990822 1.26190163 2.01562057 -1.04045187
[7] -0.96314430 0.53949869 0.02880479 0.36924105 1.33095238 0.38906016
[13] -0.93678079 0.09437538 0.55615534 0.01684863 0.53596577 0.64183623
[19] 0.94271926 0.43125758 -0.72550278 -0.50091067 -0.60211623 -0.57361422
[25] 0.31138182 0.27323214 0.67151462 0.48757117 -2.04565174 0.10195608
[31] -1.12166591 -0.58694380 -0.13315554 0.14728744 0.72130290 0.63592314
[37] -1.88655182 -0.98247828 -0.37818821 0.34892882 1.10461006 -0.68748175
[43] 1.60365308 -1.23572772 -0.11772292 0.19308130 -0.30168802 -0.13594680
[49] -0.83201485 0.30558994 0.15608280 0.61266941 1.28138346 -0.31814919
[55] 0.42472296 0.31815199 -0.88931042 0.60099834 -0.19467157 0.90567207
[61] 0.67703635 -1.08694114 -1.24237918 0.12513875 2.67242149 -1.22787035
[67] 1.04970052 0.68369285 0.16312697 -0.52676508 -0.10399531 1.76276830
[73] -0.11856181 -0.22994249 0.47396046 -0.15748422 1.48022847 2.66588082
[79] 1.08695207 -0.28032231 1.28611661 -1.03095586 0.72033145 -0.40256046
[85] 0.65979056 -0.10060006 0.30044787 0.81644355 1.25600130 0.23580470
[91] -0.95227738 0.68957742 0.29990011 -0.15571449 0.34940087 0.25699770
[97] 0.45122892 1.86796710 -2.48646496 0.75785544
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.03715007 0.7863239 -1.909908 1.261902 2.015621 -1.040452 -0.9631443
[2,] -0.03715007 0.7863239 -1.909908 1.261902 2.015621 -1.040452 -0.9631443
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.5394987 0.02880479 0.3692411 1.330952 0.3890602 -0.9367808 0.09437538
[2,] 0.5394987 0.02880479 0.3692411 1.330952 0.3890602 -0.9367808 0.09437538
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.5561553 0.01684863 0.5359658 0.6418362 0.9427193 0.4312576 -0.7255028
[2,] 0.5561553 0.01684863 0.5359658 0.6418362 0.9427193 0.4312576 -0.7255028
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.5009107 -0.6021162 -0.5736142 0.3113818 0.2732321 0.6715146 0.4875712
[2,] -0.5009107 -0.6021162 -0.5736142 0.3113818 0.2732321 0.6715146 0.4875712
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -2.045652 0.1019561 -1.121666 -0.5869438 -0.1331555 0.1472874 0.7213029
[2,] -2.045652 0.1019561 -1.121666 -0.5869438 -0.1331555 0.1472874 0.7213029
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.6359231 -1.886552 -0.9824783 -0.3781882 0.3489288 1.10461 -0.6874817
[2,] 0.6359231 -1.886552 -0.9824783 -0.3781882 0.3489288 1.10461 -0.6874817
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 1.603653 -1.235728 -0.1177229 0.1930813 -0.301688 -0.1359468 -0.8320148
[2,] 1.603653 -1.235728 -0.1177229 0.1930813 -0.301688 -0.1359468 -0.8320148
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.3055899 0.1560828 0.6126694 1.281383 -0.3181492 0.424723 0.318152
[2,] 0.3055899 0.1560828 0.6126694 1.281383 -0.3181492 0.424723 0.318152
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.8893104 0.6009983 -0.1946716 0.9056721 0.6770363 -1.086941 -1.242379
[2,] -0.8893104 0.6009983 -0.1946716 0.9056721 0.6770363 -1.086941 -1.242379
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.1251388 2.672421 -1.22787 1.049701 0.6836928 0.163127 -0.5267651
[2,] 0.1251388 2.672421 -1.22787 1.049701 0.6836928 0.163127 -0.5267651
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.1039953 1.762768 -0.1185618 -0.2299425 0.4739605 -0.1574842 1.480228
[2,] -0.1039953 1.762768 -0.1185618 -0.2299425 0.4739605 -0.1574842 1.480228
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 2.665881 1.086952 -0.2803223 1.286117 -1.030956 0.7203315 -0.4025605
[2,] 2.665881 1.086952 -0.2803223 1.286117 -1.030956 0.7203315 -0.4025605
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 0.6597906 -0.1006001 0.3004479 0.8164436 1.256001 0.2358047 -0.9522774
[2,] 0.6597906 -0.1006001 0.3004479 0.8164436 1.256001 0.2358047 -0.9522774
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 0.6895774 0.2999001 -0.1557145 0.3494009 0.2569977 0.4512289 1.867967
[2,] 0.6895774 0.2999001 -0.1557145 0.3494009 0.2569977 0.4512289 1.867967
[,99] [,100]
[1,] -2.486465 0.7578554
[2,] -2.486465 0.7578554
>
>
> Max(tmp2)
[1] 2.961194
> Min(tmp2)
[1] -2.272203
> mean(tmp2)
[1] 0.1170446
> Sum(tmp2)
[1] 11.70446
> Var(tmp2)
[1] 1.073399
>
> rowMeans(tmp2)
[1] -1.73182572 -0.84313010 0.65213744 -0.43961144 0.92230853 -0.09593494
[7] 0.46124401 0.02022183 -0.06730864 -0.17602449 0.03692161 -0.46878136
[13] 0.62955020 -0.05614102 0.18222123 1.43568748 0.59228166 -0.62707780
[19] -0.23300833 -0.79055316 -0.92517347 1.26394438 -0.16565174 0.64325387
[25] -0.72446873 0.07974199 0.08983997 -1.46598107 0.30647479 -1.68152980
[31] 1.18162340 1.56980395 -0.19877095 0.63686626 -0.11941831 1.03056951
[37] -2.24029769 -1.23019308 -0.57982476 0.24977979 -0.29595910 -2.27220267
[43] 0.36822816 -0.27473777 -1.23745904 0.02247075 0.91584299 0.56105619
[49] 0.44898019 -0.55794346 -0.53009042 2.15098884 -0.54070221 -0.75234711
[55] 1.67255467 0.88280288 -0.35151182 -0.09832172 -0.84048490 0.74026232
[61] -0.01805588 -1.62410832 -0.04302842 0.20829142 1.52059941 0.54492193
[67] -1.43606387 0.36962430 -0.41911270 0.16534130 1.80891699 0.01401016
[73] 1.49985528 -0.91048942 0.24197468 -0.63939679 0.85995463 -0.42270817
[79] 0.10436655 0.53027105 1.48520742 1.42676347 -0.84083586 0.75831774
[85] 1.50987033 2.50210217 -0.76182923 2.89674058 1.09341017 1.09058819
[91] -0.44804153 -1.21071941 -0.30211538 0.46006399 0.87144781 1.19510055
[97] -1.14308813 -1.55751217 0.22743989 2.96119384
> rowSums(tmp2)
[1] -1.73182572 -0.84313010 0.65213744 -0.43961144 0.92230853 -0.09593494
[7] 0.46124401 0.02022183 -0.06730864 -0.17602449 0.03692161 -0.46878136
[13] 0.62955020 -0.05614102 0.18222123 1.43568748 0.59228166 -0.62707780
[19] -0.23300833 -0.79055316 -0.92517347 1.26394438 -0.16565174 0.64325387
[25] -0.72446873 0.07974199 0.08983997 -1.46598107 0.30647479 -1.68152980
[31] 1.18162340 1.56980395 -0.19877095 0.63686626 -0.11941831 1.03056951
[37] -2.24029769 -1.23019308 -0.57982476 0.24977979 -0.29595910 -2.27220267
[43] 0.36822816 -0.27473777 -1.23745904 0.02247075 0.91584299 0.56105619
[49] 0.44898019 -0.55794346 -0.53009042 2.15098884 -0.54070221 -0.75234711
[55] 1.67255467 0.88280288 -0.35151182 -0.09832172 -0.84048490 0.74026232
[61] -0.01805588 -1.62410832 -0.04302842 0.20829142 1.52059941 0.54492193
[67] -1.43606387 0.36962430 -0.41911270 0.16534130 1.80891699 0.01401016
[73] 1.49985528 -0.91048942 0.24197468 -0.63939679 0.85995463 -0.42270817
[79] 0.10436655 0.53027105 1.48520742 1.42676347 -0.84083586 0.75831774
[85] 1.50987033 2.50210217 -0.76182923 2.89674058 1.09341017 1.09058819
[91] -0.44804153 -1.21071941 -0.30211538 0.46006399 0.87144781 1.19510055
[97] -1.14308813 -1.55751217 0.22743989 2.96119384
> rowVars(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
[1] -1.73182572 -0.84313010 0.65213744 -0.43961144 0.92230853 -0.09593494
[7] 0.46124401 0.02022183 -0.06730864 -0.17602449 0.03692161 -0.46878136
[13] 0.62955020 -0.05614102 0.18222123 1.43568748 0.59228166 -0.62707780
[19] -0.23300833 -0.79055316 -0.92517347 1.26394438 -0.16565174 0.64325387
[25] -0.72446873 0.07974199 0.08983997 -1.46598107 0.30647479 -1.68152980
[31] 1.18162340 1.56980395 -0.19877095 0.63686626 -0.11941831 1.03056951
[37] -2.24029769 -1.23019308 -0.57982476 0.24977979 -0.29595910 -2.27220267
[43] 0.36822816 -0.27473777 -1.23745904 0.02247075 0.91584299 0.56105619
[49] 0.44898019 -0.55794346 -0.53009042 2.15098884 -0.54070221 -0.75234711
[55] 1.67255467 0.88280288 -0.35151182 -0.09832172 -0.84048490 0.74026232
[61] -0.01805588 -1.62410832 -0.04302842 0.20829142 1.52059941 0.54492193
[67] -1.43606387 0.36962430 -0.41911270 0.16534130 1.80891699 0.01401016
[73] 1.49985528 -0.91048942 0.24197468 -0.63939679 0.85995463 -0.42270817
[79] 0.10436655 0.53027105 1.48520742 1.42676347 -0.84083586 0.75831774
[85] 1.50987033 2.50210217 -0.76182923 2.89674058 1.09341017 1.09058819
[91] -0.44804153 -1.21071941 -0.30211538 0.46006399 0.87144781 1.19510055
[97] -1.14308813 -1.55751217 0.22743989 2.96119384
> rowMin(tmp2)
[1] -1.73182572 -0.84313010 0.65213744 -0.43961144 0.92230853 -0.09593494
[7] 0.46124401 0.02022183 -0.06730864 -0.17602449 0.03692161 -0.46878136
[13] 0.62955020 -0.05614102 0.18222123 1.43568748 0.59228166 -0.62707780
[19] -0.23300833 -0.79055316 -0.92517347 1.26394438 -0.16565174 0.64325387
[25] -0.72446873 0.07974199 0.08983997 -1.46598107 0.30647479 -1.68152980
[31] 1.18162340 1.56980395 -0.19877095 0.63686626 -0.11941831 1.03056951
[37] -2.24029769 -1.23019308 -0.57982476 0.24977979 -0.29595910 -2.27220267
[43] 0.36822816 -0.27473777 -1.23745904 0.02247075 0.91584299 0.56105619
[49] 0.44898019 -0.55794346 -0.53009042 2.15098884 -0.54070221 -0.75234711
[55] 1.67255467 0.88280288 -0.35151182 -0.09832172 -0.84048490 0.74026232
[61] -0.01805588 -1.62410832 -0.04302842 0.20829142 1.52059941 0.54492193
[67] -1.43606387 0.36962430 -0.41911270 0.16534130 1.80891699 0.01401016
[73] 1.49985528 -0.91048942 0.24197468 -0.63939679 0.85995463 -0.42270817
[79] 0.10436655 0.53027105 1.48520742 1.42676347 -0.84083586 0.75831774
[85] 1.50987033 2.50210217 -0.76182923 2.89674058 1.09341017 1.09058819
[91] -0.44804153 -1.21071941 -0.30211538 0.46006399 0.87144781 1.19510055
[97] -1.14308813 -1.55751217 0.22743989 2.96119384
>
> colMeans(tmp2)
[1] 0.1170446
> colSums(tmp2)
[1] 11.70446
> colVars(tmp2)
[1] 1.073399
> colSd(tmp2)
[1] 1.03605
> colMax(tmp2)
[1] 2.961194
> colMin(tmp2)
[1] -2.272203
> colMedians(tmp2)
[1] 0.02969618
> colRanges(tmp2)
[,1]
[1,] -2.272203
[2,] 2.961194
>
> 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.7878176 -2.3546075 -2.9724741 -2.6597162 3.5825174 0.5693748
[7] -3.8294962 3.0017641 -2.7659524 3.2389145
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.09784996
[2,] -0.45415839
[3,] -0.03961759
[4,] 0.79477759
[5,] 2.08213823
>
> rowApply(tmp,sum)
[1] 0.37735509 0.06336768 -1.35843004 -2.98304118 -0.57004961 5.41689306
[7] 5.11655594 0.01887344 -2.33336793 -6.15001436
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 10 10 1 7 6 9 2 4 8 10
[2,] 8 9 3 6 1 8 10 2 2 2
[3,] 9 4 5 2 2 3 5 5 7 3
[4,] 1 7 10 5 4 6 1 3 6 6
[5,] 5 8 8 8 8 1 9 9 5 8
[6,] 3 1 6 10 9 4 6 8 1 9
[7,] 6 3 4 4 5 2 4 10 3 1
[8,] 4 6 9 1 10 10 3 6 4 5
[9,] 2 2 2 3 3 5 7 7 9 7
[10,] 7 5 7 9 7 7 8 1 10 4
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -2.01805110 -0.22751555 -1.08500433 -1.26768016 -2.62897893 1.32872776
[7] 1.75322151 2.66976866 -3.52907661 4.23425752 2.30693666 2.81870165
[13] 1.37498886 -1.05584476 -0.01090739 0.13183058 -2.20129238 1.34822191
[19] 2.08666704 -1.53829960
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.3624604
[2,] -0.8476254
[3,] -0.6104427
[4,] -0.5858494
[5,] 1.3883268
>
> rowApply(tmp,sum)
[1] 2.543101 -1.195563 9.571605 -3.208843 -3.219628
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 6 17 9 3
[2,] 19 2 14 6 5
[3,] 3 1 20 3 11
[4,] 7 8 15 12 2
[5,] 11 4 2 4 15
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.6104427 1.9559805 -1.1895519 -0.53634549 0.2779862 -0.01734189
[2,] -0.8476254 -1.4838273 -1.8590144 -0.45408792 -1.2570497 1.35763533
[3,] 1.3883268 1.0277512 3.2133652 1.08596015 -0.8928789 -0.58551233
[4,] -0.5858494 -0.8987794 -1.0903713 0.03741643 -1.0070527 0.49028606
[5,] -1.3624604 -0.8286405 -0.1594319 -1.40062334 0.2500162 0.08366060
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.8216355 0.8467320 -0.7370873 0.5232556 -0.1253176 0.2406258
[2,] -0.3637960 0.9033006 -0.2020157 1.2127348 0.2263177 -0.7515715
[3,] -1.0283878 0.5519595 -0.1971728 -0.7166626 1.7821622 0.4313177
[4,] 1.0017231 1.0442744 -1.8769221 1.7577004 0.7879512 0.9403285
[5,] 1.3220468 -0.6764978 -0.5158787 1.4572293 -0.3641769 1.9580012
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 2.20837326 -1.5225145 -0.76849263 0.2970807 -1.4340926 0.5190007
[2,] -1.29447510 -0.4309559 0.76240578 1.6234317 0.4756436 0.9496519
[3,] 0.01296089 0.9903173 0.02675531 -0.1144614 0.2694993 1.5468600
[4,] 0.58396421 -0.8837741 -0.87535594 -1.7887684 -0.4198589 -0.9215908
[5,] -0.13583439 0.7910823 0.84378009 0.1145480 -1.0924838 -0.7456998
[,19] [,20]
[1,] 1.0399634 0.7536542
[2,] -0.9043564 1.1420904
[3,] 1.2742830 -0.4948379
[4,] 0.9823039 -0.4864679
[5,] -0.3055267 -2.4527384
>
>
> 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 : 654 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.870897 1.105126 -0.4965026 1.556839 0.3237133 0.670856 -0.6384666
col8 col9 col10 col11 col12 col13 col14
row1 -0.6116377 0.869242 0.2160294 -0.1817183 0.2824311 -0.5292337 0.7703132
col15 col16 col17 col18 col19 col20
row1 0.2043479 0.8561113 1.063109 0.996199 0.5738837 -1.08397
> tmp[,"col10"]
col10
row1 0.2160294
row2 1.2264817
row3 0.2875168
row4 -0.6106070
row5 -0.5660432
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -0.870897 1.105126 -0.4965026 1.5568393 0.32371331 0.6708560 -0.6384666
row5 1.229421 -1.857132 -1.3639847 0.5052444 0.07862529 0.8417351 -0.3234243
col8 col9 col10 col11 col12 col13 col14
row1 -0.6116377 0.869242 0.2160294 -0.1817183 0.2824311 -0.5292337 0.7703132
row5 -1.6532310 -2.488884 -0.5660432 -0.1954043 0.6299426 1.1973598 2.0977243
col15 col16 col17 col18 col19 col20
row1 0.2043479 0.8561113 1.063109 0.9961990 0.5738837 -1.0839702
row5 0.2507716 0.6860222 1.761572 -0.7109289 0.6361800 0.6273194
> tmp[,c("col6","col20")]
col6 col20
row1 0.67085602 -1.0839702
row2 -1.75986710 0.9791108
row3 0.08651586 0.9253115
row4 0.85744699 -1.4140516
row5 0.84173508 0.6273194
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.6708560 -1.0839702
row5 0.8417351 0.6273194
>
>
>
>
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105)
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.79929 51.43523 49.12669 49.90786 48.48374 103.9686 50.12856 48.42991
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.781 47.87936 49.44722 51.24355 50.46478 51.41985 48.78954 50.8951
col17 col18 col19 col20
row1 48.67051 51.26838 50.10412 104.8332
> tmp[,"col10"]
col10
row1 47.87936
row2 30.59689
row3 30.66087
row4 31.01325
row5 49.43216
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.79929 51.43523 49.12669 49.90786 48.48374 103.9686 50.12856 48.42991
row5 51.75721 49.08515 50.32286 50.20608 51.45199 107.3554 49.02400 48.63962
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.7810 47.87936 49.44722 51.24355 50.46478 51.41985 48.78954 50.89510
row5 49.1412 49.43216 50.43583 51.30499 51.59266 48.55823 51.30801 51.23428
col17 col18 col19 col20
row1 48.67051 51.26838 50.10412 104.8332
row5 50.26465 49.74635 49.37867 104.7435
> tmp[,c("col6","col20")]
col6 col20
row1 103.96858 104.83316
row2 74.66033 73.71350
row3 75.62594 75.49154
row4 74.73081 74.97443
row5 107.35537 104.74350
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 103.9686 104.8332
row5 107.3554 104.7435
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 103.9686 104.8332
row5 107.3554 104.7435
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.7344260
[2,] -0.3198700
[3,] 0.3691221
[4,] 1.3909221
[5,] -0.1310122
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.8443586 -0.27125808
[2,] 1.2303112 -0.43674084
[3,] 1.1882125 -0.10421358
[4,] -0.3000301 -0.03217633
[5,] 0.4114324 0.14105307
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.67774699 -0.1694754
[2,] -2.15056373 -1.0959969
[3,] 0.89636645 -1.3155116
[4,] 1.84628126 1.5969351
[5,] -0.02384538 -1.2242242
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.677747
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.677747
[2,] -2.150564
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row3 1.6478013 -0.7135192 -0.3908904 1.030443 -0.2633303 -0.3829796
row1 -0.2011517 0.6045544 -0.7241161 -1.617538 -0.2024141 0.3119721
[,7] [,8] [,9] [,10] [,11] [,12]
row3 0.9551277 0.7543227 0.8371741 2.54602542 0.9425407 -0.2400852
row1 -0.4633198 -0.1680219 -0.7998871 -0.08408834 -2.1933242 2.2209226
[,13] [,14] [,15] [,16] [,17] [,18]
row3 -0.51771139 2.11473106 -0.8824696 -0.1209867 1.1053427 -1.0833104
row1 0.05915907 -0.06002035 0.4388727 0.5451726 0.9263275 0.4377687
[,19] [,20]
row3 0.0887023 0.8360667
row1 1.9636155 0.2330308
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 1.004531 -0.7917805 0.2168608 -1.734387 -0.8217604 0.9854249 0.04100765
[,8] [,9] [,10]
row2 1.045316 1.296141 0.04599286
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.4512411 -0.4262066 1.223617 0.5893029 1.609389 1.348536 -1.393522
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.5637406 0.6523394 0.02380592 -1.610591 -0.2183676 0.1494067 0.6609161
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.570431 1.401609 -1.09717 1.015086 -1.754028 0.6807613
>
>
> 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: 0x5a4ee6c14db0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM39bcd8595b7a6a"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM39bcd86428321a"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM39bcd87d732b11"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM39bcd828621cba"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM39bcd87723dc09"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM39bcd811600320"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM39bcd8ffd3899"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM39bcd817faad3e"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM39bcd8a432ce0"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM39bcd840ae89a0"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM39bcd843105b8d"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM39bcd827caa20e"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM39bcd818b8ad8b"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM39bcd82ccc786f"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM39bcd8a11af8"
>
>
> ### 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: 0x5a4ee6f781f0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5a4ee6f781f0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5a4ee6f781f0>
> rowMedians(tmp)
[1] -0.3413444526 0.7444727893 0.0058473586 -0.3057786699 0.2917991093
[6] -0.1256762033 0.1899143731 -0.0312098638 -0.3385575459 0.0543362786
[11] -0.0107234254 -0.6477667275 -0.1331686263 -0.2878810120 -0.1492188065
[16] -0.0103250976 -0.0970022432 0.1627785057 -0.2459397867 0.0993987327
[21] -0.0378766690 0.2531777394 0.4709184213 0.2254486056 -0.5965279623
[26] -0.2950151432 0.0087877618 -0.3066296836 0.4141884673 -0.3264916484
[31] -0.1492351718 0.1969442110 -0.0113927707 0.0141999278 0.1251455130
[36] 0.1821296345 -0.7310067121 0.2011005252 -0.0056466819 -0.1333944600
[41] 0.2563118827 -0.3197212826 0.2134566137 -0.3448339492 0.0645811781
[46] 0.0986991295 0.1186433940 0.0832173419 0.2221372863 -0.1303527505
[51] -0.4519866787 -0.5511295319 0.0832283560 -0.3368866796 -0.1292311075
[56] -0.3258681037 -0.3003576912 0.4798105800 0.4492899282 0.2379758668
[61] -0.1196693032 -0.0742910073 0.1044682681 -0.0382590426 0.0358379315
[66] -0.0230377254 -0.1785592992 0.1351083842 -0.5979138739 0.2368447298
[71] 0.0979466900 -0.0858251653 0.4460321646 0.6219736388 0.1505423859
[76] -0.0829679315 0.1219507777 0.1818944287 -0.2920855382 -0.3284796454
[81] -0.2398346803 0.4550273103 -0.1792063883 0.1632153101 -0.4456045597
[86] -0.2789370814 -0.1318295497 0.1900295098 0.1652502112 0.2190594172
[91] 0.2868970272 -0.1388780949 0.0356756226 -0.0080669123 0.1763206740
[96] 0.5724845605 -0.2287600559 0.4160494704 0.3500299058 -0.2990759952
[101] 0.5349322878 0.2303214660 -0.1237147087 0.2333573035 -0.0016773472
[106] -0.5617348733 0.1830261364 -0.0194127457 0.4337974436 0.9796329437
[111] -0.2156311438 -0.5642356631 -0.0367742462 -0.1435905303 -0.3320110163
[116] -0.1179430507 -0.3341755565 0.0519183519 -0.0096970052 -0.0290719891
[121] 0.0884385804 -0.0427535965 0.1826486543 -0.3884979903 -0.0460178826
[126] 0.0707762168 0.1960055566 0.5162026398 0.0386335454 0.0478605976
[131] 0.1412004128 0.0534223871 -0.0635796661 0.1118263043 0.3295807491
[136] 0.0662454091 -0.4318513351 0.2610448666 0.1515206974 -0.5460816077
[141] 0.0188475929 -0.0063704642 0.2598804470 -0.8070461069 0.2030786739
[146] 0.0070586038 0.1684722517 -0.0984125850 0.1528734376 0.0290398110
[151] 0.3987540615 -0.0742714652 -0.0001763684 0.7860758110 -0.2782584129
[156] 0.1594330963 0.0637844983 0.2889645022 -0.2400556667 0.5259108815
[161] 0.1849216405 -0.0812577056 0.1291533377 -0.0678736561 0.2970410364
[166] 0.0504214709 0.3459038571 -0.0290638627 -0.6361010529 -0.3957603943
[171] -0.0638589734 0.5949737735 0.1970880925 -0.1887613643 -0.1435022160
[176] -0.1464714157 -0.4516399206 0.3132403736 0.2199138581 -0.1891719191
[181] 0.1875696632 -0.5948147297 0.0748476842 0.0307020258 -0.2570548494
[186] 0.1766260785 0.1993751956 -0.0412936256 -0.0555160796 -0.0250934110
[191] -0.3820868240 -0.5046299583 -0.2022213606 -0.5504994066 -0.1735596457
[196] -0.2634607015 0.0328595635 0.4947171678 -0.0416913623 -0.2354486761
[201] 0.4047557689 0.6776972283 0.5760211024 0.4775349922 -0.3693959457
[206] -0.7616365583 -0.3240694464 -0.4558864180 -0.2983076398 -0.1920158120
[211] 0.1706620457 -0.1393584860 -0.1589012087 0.0131911349 -0.2959881581
[216] -0.3621280927 0.1136118846 0.3435938129 -0.3567056178 -0.2691053154
[221] -0.2278002965 -0.4931835103 -0.1742951427 0.3772019090 0.1045329705
[226] -0.0704772146 0.4964592280 0.1740223974 0.1650400416 -0.0011447049
>
> proc.time()
user system elapsed
1.297 1.440 2.727
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: 0x5be7c9d36c10>
> .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: 0x5be7c9d36c10>
> .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: 0x5be7c9d36c10>
> .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: 0x5be7c9d36c10>
> 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: 0x5be7ca9f92d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5be7ca9f92d0>
> .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: 0x5be7ca9f92d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5be7ca9f92d0>
> .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: 0x5be7ca9f92d0>
> 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: 0x5be7cb0ced70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5be7cb0ced70>
> .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: 0x5be7cb0ced70>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5be7cb0ced70>
> .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: 0x5be7cb0ced70>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5be7cb0ced70>
> .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: 0x5be7cb0ced70>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5be7cb0ced70>
> .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: 0x5be7cb0ced70>
> 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: 0x5be7cac42370>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5be7cac42370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5be7cac42370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5be7cac42370>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile39bfa3165ecddd" "BufferedMatrixFile39bfa3d7a03bc"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile39bfa3165ecddd" "BufferedMatrixFile39bfa3d7a03bc"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5be7cab8dff0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5be7cab8dff0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5be7cab8dff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5be7cab8dff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5be7cab8dff0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5be7cab8dff0>
> .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: 0x5be7cad665b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5be7cad665b0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5be7cad665b0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5be7cad665b0>
> 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: 0x5be7cbd43500>
> .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: 0x5be7cbd43500>
> rm(P)
>
> proc.time()
user system elapsed
0.265 0.055 0.310
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.245 0.037 0.271