| Back to Build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-02-10 11:32 -0500 (Tue, 10 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" | 4862 |
| 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 255/2351 | 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-09 21:50:54 -0500 (Mon, 09 Feb 2026) |
| EndedAt: 2026-02-09 21:51:19 -0500 (Mon, 09 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.255 0.045 0.288
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] "Mon Feb 9 21:51:09 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] "Mon Feb 9 21:51:09 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: 0x56f6b2532c10>
>
>
>
> 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] "Mon Feb 9 21:51:09 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] "Mon Feb 9 21:51:10 2026"
>
> ColMode(tmp2)
<pointer: 0x56f6b2532c10>
>
>
>
> ### 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.8419660 -0.1834200 -0.55825226 -0.2614510
[2,] 0.5488346 0.0272046 2.16968232 0.4993689
[3,] -0.6865014 0.9822156 -1.47524277 1.4023917
[4,] -1.3201243 -0.6055049 0.02014368 -1.4205803
> 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.8419660 0.1834200 0.55825226 0.2614510
[2,] 0.5488346 0.0272046 2.16968232 0.4993689
[3,] 0.6865014 0.9822156 1.47524277 1.4023917
[4,] 1.3201243 0.6055049 0.02014368 1.4205803
> 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.9920952 0.4282756 0.7471628 0.5113228
[2,] 0.7408337 0.1649382 1.4729842 0.7066604
[3,] 0.8285538 0.9910679 1.2145957 1.1842262
[4,] 1.1489666 0.7781419 0.1419284 1.1918810
>
> 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,] 224.76292 29.46618 33.02988 30.37468
[2,] 32.95717 26.67659 41.89952 32.56597
[3,] 33.97204 35.89289 38.62120 38.24465
[4,] 37.80979 33.38692 26.43943 38.33939
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x56f6b3389ff0>
> exp(tmp5)
<pointer: 0x56f6b3389ff0>
> log(tmp5,2)
<pointer: 0x56f6b3389ff0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.8146
> Min(tmp5)
[1] 53.33496
> mean(tmp5)
[1] 71.7357
> Sum(tmp5)
[1] 14347.14
> Var(tmp5)
[1] 848.1862
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.85520 70.73580 72.25330 69.08982 69.67466 68.27075 68.75889 71.25892
[9] 68.54850 68.91118
> rowSums(tmp5)
[1] 1797.104 1414.716 1445.066 1381.796 1393.493 1365.415 1375.178 1425.178
[9] 1370.970 1378.224
> rowVars(tmp5)
[1] 7954.06692 82.31822 70.56843 69.54357 63.46967 56.13657
[7] 37.69431 61.22649 47.74611 40.79724
> rowSd(tmp5)
[1] 89.185576 9.072939 8.400502 8.339279 7.966786 7.492434 6.139570
[8] 7.824736 6.909856 6.387272
> rowMax(tmp5)
[1] 467.81457 87.20837 86.63527 83.51657 83.23255 79.22237 83.51217
[8] 80.75805 82.01795 79.89841
> rowMin(tmp5)
[1] 53.85879 55.52382 55.89992 53.33496 58.97909 56.23941 59.56733 56.82825
[9] 58.67988 58.80613
>
> colMeans(tmp5)
[1] 110.15859 67.85858 72.59247 68.02431 65.80914 67.18629 69.01292
[8] 70.28354 69.48377 67.91797 71.41273 71.31037 70.31806 66.65259
[15] 72.73875 69.82613 72.97448 70.84966 71.02671 69.27698
> colSums(tmp5)
[1] 1101.5859 678.5858 725.9247 680.2431 658.0914 671.8629 690.1292
[8] 702.8354 694.8377 679.1797 714.1273 713.1037 703.1806 666.5259
[15] 727.3875 698.2613 729.7448 708.4966 710.2671 692.7698
> colVars(tmp5)
[1] 15831.33736 53.87358 98.20447 59.37630 43.20492 47.92327
[7] 87.21015 28.38722 66.59832 78.06083 54.26083 73.02149
[13] 27.48116 36.22880 80.16264 54.01339 17.13851 111.67203
[19] 56.06681 36.22533
> colSd(tmp5)
[1] 125.822642 7.339863 9.909817 7.705602 6.573045 6.922664
[7] 9.338637 5.327966 8.160779 8.835204 7.366195 8.545261
[13] 5.242248 6.019037 8.953359 7.349381 4.139869 10.567499
[19] 7.487777 6.018748
> colMax(tmp5)
[1] 467.81457 78.23800 87.20837 79.79842 75.97772 75.08203 83.45091
[8] 80.70181 86.63527 82.09925 84.55911 83.23255 78.14614 77.03542
[15] 83.51657 79.28935 79.20430 83.51217 79.22237 76.01281
> colMin(tmp5)
[1] 63.11071 55.52382 55.03020 56.23941 57.07089 56.81860 56.62251 62.22861
[9] 58.67988 53.33496 59.49586 55.89992 61.54318 58.80613 61.02433 58.83419
[17] 66.79046 53.85879 58.68625 59.01300
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 89.85520 70.73580 72.25330 69.08982 69.67466 NA 68.75889 71.25892
[9] 68.54850 68.91118
> rowSums(tmp5)
[1] 1797.104 1414.716 1445.066 1381.796 1393.493 NA 1375.178 1425.178
[9] 1370.970 1378.224
> rowVars(tmp5)
[1] 7954.06692 82.31822 70.56843 69.54357 63.46967 55.73454
[7] 37.69431 61.22649 47.74611 40.79724
> rowSd(tmp5)
[1] 89.185576 9.072939 8.400502 8.339279 7.966786 7.465557 6.139570
[8] 7.824736 6.909856 6.387272
> rowMax(tmp5)
[1] 467.81457 87.20837 86.63527 83.51657 83.23255 NA 83.51217
[8] 80.75805 82.01795 79.89841
> rowMin(tmp5)
[1] 53.85879 55.52382 55.89992 53.33496 58.97909 NA 59.56733 56.82825
[9] 58.67988 58.80613
>
> colMeans(tmp5)
[1] 110.15859 NA 72.59247 68.02431 65.80914 67.18629 69.01292
[8] 70.28354 69.48377 67.91797 71.41273 71.31037 70.31806 66.65259
[15] 72.73875 69.82613 72.97448 70.84966 71.02671 69.27698
> colSums(tmp5)
[1] 1101.5859 NA 725.9247 680.2431 658.0914 671.8629 690.1292
[8] 702.8354 694.8377 679.1797 714.1273 713.1037 703.1806 666.5259
[15] 727.3875 698.2613 729.7448 708.4966 710.2671 692.7698
> colVars(tmp5)
[1] 15831.33736 NA 98.20447 59.37630 43.20492 47.92327
[7] 87.21015 28.38722 66.59832 78.06083 54.26083 73.02149
[13] 27.48116 36.22880 80.16264 54.01339 17.13851 111.67203
[19] 56.06681 36.22533
> colSd(tmp5)
[1] 125.822642 NA 9.909817 7.705602 6.573045 6.922664
[7] 9.338637 5.327966 8.160779 8.835204 7.366195 8.545261
[13] 5.242248 6.019037 8.953359 7.349381 4.139869 10.567499
[19] 7.487777 6.018748
> colMax(tmp5)
[1] 467.81457 NA 87.20837 79.79842 75.97772 75.08203 83.45091
[8] 80.70181 86.63527 82.09925 84.55911 83.23255 78.14614 77.03542
[15] 83.51657 79.28935 79.20430 83.51217 79.22237 76.01281
> colMin(tmp5)
[1] 63.11071 NA 55.03020 56.23941 57.07089 56.81860 56.62251 62.22861
[9] 58.67988 53.33496 59.49586 55.89992 61.54318 58.80613 61.02433 58.83419
[17] 66.79046 53.85879 58.68625 59.01300
>
> Max(tmp5,na.rm=TRUE)
[1] 467.8146
> Min(tmp5,na.rm=TRUE)
[1] 53.33496
> mean(tmp5,na.rm=TRUE)
[1] 71.7921
> Sum(tmp5,na.rm=TRUE)
[1] 14286.63
> Var(tmp5,na.rm=TRUE)
[1] 851.8305
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.85520 70.73580 72.25330 69.08982 69.67466 68.67913 68.75889 71.25892
[9] 68.54850 68.91118
> rowSums(tmp5,na.rm=TRUE)
[1] 1797.104 1414.716 1445.066 1381.796 1393.493 1304.903 1375.178 1425.178
[9] 1370.970 1378.224
> rowVars(tmp5,na.rm=TRUE)
[1] 7954.06692 82.31822 70.56843 69.54357 63.46967 55.73454
[7] 37.69431 61.22649 47.74611 40.79724
> rowSd(tmp5,na.rm=TRUE)
[1] 89.185576 9.072939 8.400502 8.339279 7.966786 7.465557 6.139570
[8] 7.824736 6.909856 6.387272
> rowMax(tmp5,na.rm=TRUE)
[1] 467.81457 87.20837 86.63527 83.51657 83.23255 79.22237 83.51217
[8] 80.75805 82.01795 79.89841
> rowMin(tmp5,na.rm=TRUE)
[1] 53.85879 55.52382 55.89992 53.33496 58.97909 56.23941 59.56733 56.82825
[9] 58.67988 58.80613
>
> colMeans(tmp5,na.rm=TRUE)
[1] 110.15859 68.67491 72.59247 68.02431 65.80914 67.18629 69.01292
[8] 70.28354 69.48377 67.91797 71.41273 71.31037 70.31806 66.65259
[15] 72.73875 69.82613 72.97448 70.84966 71.02671 69.27698
> colSums(tmp5,na.rm=TRUE)
[1] 1101.5859 618.0742 725.9247 680.2431 658.0914 671.8629 690.1292
[8] 702.8354 694.8377 679.1797 714.1273 713.1037 703.1806 666.5259
[15] 727.3875 698.2613 729.7448 708.4966 710.2671 692.7698
> colVars(tmp5,na.rm=TRUE)
[1] 15831.33736 53.11081 98.20447 59.37630 43.20492 47.92327
[7] 87.21015 28.38722 66.59832 78.06083 54.26083 73.02149
[13] 27.48116 36.22880 80.16264 54.01339 17.13851 111.67203
[19] 56.06681 36.22533
> colSd(tmp5,na.rm=TRUE)
[1] 125.822642 7.287717 9.909817 7.705602 6.573045 6.922664
[7] 9.338637 5.327966 8.160779 8.835204 7.366195 8.545261
[13] 5.242248 6.019037 8.953359 7.349381 4.139869 10.567499
[19] 7.487777 6.018748
> colMax(tmp5,na.rm=TRUE)
[1] 467.81457 78.23800 87.20837 79.79842 75.97772 75.08203 83.45091
[8] 80.70181 86.63527 82.09925 84.55911 83.23255 78.14614 77.03542
[15] 83.51657 79.28935 79.20430 83.51217 79.22237 76.01281
> colMin(tmp5,na.rm=TRUE)
[1] 63.11071 55.52382 55.03020 56.23941 57.07089 56.81860 56.62251 62.22861
[9] 58.67988 53.33496 59.49586 55.89992 61.54318 58.80613 61.02433 58.83419
[17] 66.79046 53.85879 58.68625 59.01300
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.85520 70.73580 72.25330 69.08982 69.67466 NaN 68.75889 71.25892
[9] 68.54850 68.91118
> rowSums(tmp5,na.rm=TRUE)
[1] 1797.104 1414.716 1445.066 1381.796 1393.493 0.000 1375.178 1425.178
[9] 1370.970 1378.224
> rowVars(tmp5,na.rm=TRUE)
[1] 7954.06692 82.31822 70.56843 69.54357 63.46967 NA
[7] 37.69431 61.22649 47.74611 40.79724
> rowSd(tmp5,na.rm=TRUE)
[1] 89.185576 9.072939 8.400502 8.339279 7.966786 NA 6.139570
[8] 7.824736 6.909856 6.387272
> rowMax(tmp5,na.rm=TRUE)
[1] 467.81457 87.20837 86.63527 83.51657 83.23255 NA 83.51217
[8] 80.75805 82.01795 79.89841
> rowMin(tmp5,na.rm=TRUE)
[1] 53.85879 55.52382 55.89992 53.33496 58.97909 NA 59.56733 56.82825
[9] 58.67988 58.80613
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 113.95062 NaN 74.13308 69.33375 66.04025 68.33825 68.73957
[8] 70.83394 69.11862 67.29573 71.44241 71.66551 69.60599 66.71262
[15] 73.36503 69.95398 72.28228 72.28275 70.11608 68.52855
> colSums(tmp5,na.rm=TRUE)
[1] 1025.5556 0.0000 667.1978 624.0037 594.3622 615.0443 618.6561
[8] 637.5054 622.0676 605.6615 642.9817 644.9896 626.4539 600.4136
[15] 660.2853 629.5858 650.5405 650.5448 631.0448 616.7569
> colVars(tmp5,na.rm=TRUE)
[1] 17648.48567 NA 83.77820 47.50889 48.00463 38.98466
[7] 97.27078 28.52757 73.42317 83.46257 61.03353 80.73026
[13] 25.21208 40.71686 85.77042 60.58117 13.89047 102.52631
[19] 53.74617 34.45191
> colSd(tmp5,na.rm=TRUE)
[1] 132.847603 NA 9.153043 6.892669 6.928538 6.243770
[7] 9.862595 5.341121 8.568732 9.135785 7.812396 8.985002
[13] 5.021163 6.380977 9.261232 7.783391 3.726992 10.125528
[19] 7.331178 5.869575
> colMax(tmp5,na.rm=TRUE)
[1] 467.81457 -Inf 87.20837 79.79842 75.97772 75.08203 83.45091
[8] 80.70181 86.63527 82.09925 84.55911 83.23255 78.14614 77.03542
[15] 83.51657 79.28935 76.26407 83.51217 78.10534 75.75297
> colMin(tmp5,na.rm=TRUE)
[1] 63.11071 Inf 55.03020 59.20224 57.07089 56.82825 56.62251 62.22861
[9] 58.67988 53.33496 59.49586 55.89992 61.54318 58.80613 61.02433 58.83419
[17] 66.79046 53.85879 58.68625 59.01300
>
>
>
>
> 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] 196.7353 249.1305 187.9525 245.2392 273.8683 261.8747 174.9513 144.2682
[9] 227.1499 186.1059
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 196.7353 249.1305 187.9525 245.2392 273.8683 261.8747 174.9513 144.2682
[9] 227.1499 186.1059
>
>
>
> 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] 0.000000e+00 -1.136868e-13 4.263256e-14 0.000000e+00 1.136868e-13
[6] 8.526513e-14 -2.842171e-13 1.421085e-13 -8.526513e-14 0.000000e+00
[11] 0.000000e+00 -8.526513e-14 2.842171e-14 0.000000e+00 -3.410605e-13
[16] 5.684342e-14 8.526513e-14 -1.136868e-13 -5.684342e-14 0.000000e+00
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
6 10
3 2
7 20
4 19
10 3
4 2
10 16
2 18
1 20
4 19
9 16
8 9
6 7
1 7
10 15
7 2
9 10
10 12
1 1
10 7
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.398965
> Min(tmp)
[1] -2.050961
> mean(tmp)
[1] 0.2344369
> Sum(tmp)
[1] 23.44369
> Var(tmp)
[1] 0.8566784
>
> rowMeans(tmp)
[1] 0.2344369
> rowSums(tmp)
[1] 23.44369
> rowVars(tmp)
[1] 0.8566784
> rowSd(tmp)
[1] 0.9255692
> rowMax(tmp)
[1] 2.398965
> rowMin(tmp)
[1] -2.050961
>
> colMeans(tmp)
[1] 0.02130937 -0.91641372 1.86211396 1.55787533 0.44628552 -1.06798907
[7] 0.13395170 -0.70774490 -0.24961314 -0.58280212 1.55986240 -0.24932970
[13] 0.28952198 0.10612284 0.95021485 -0.31350270 -0.04399344 1.33204053
[19] 0.41631027 -0.17264587 -0.79223044 0.51866163 2.19260409 0.86595735
[25] 1.01868336 -0.57018015 0.25250128 1.13588504 -0.39441858 0.15746474
[31] 0.91428394 -0.64277981 -0.62764247 1.40093438 0.08106506 2.39896533
[37] -0.11864038 -0.16917905 1.53215217 -1.68508796 -0.42979956 0.01878607
[43] 0.18258156 0.32931903 0.58614838 0.54195617 0.09868817 0.02152417
[49] 0.60738146 1.14970045 0.30136579 0.84397975 1.89784363 0.84975101
[55] -0.45069350 -1.53156394 0.17755147 0.50601468 -0.66713260 -0.84648411
[61] 0.89900079 0.08841236 -0.30239512 -0.39098673 0.85871312 -0.33050989
[67] 1.89785277 0.57155190 -1.47549713 0.31659351 1.05555150 0.95640578
[73] -2.05096137 1.01439482 0.10197020 -1.51364697 -0.35155399 1.62392302
[79] 1.17893759 0.02138937 0.16211315 1.12035310 -1.72436155 1.10381822
[85] 0.32852923 1.09613532 0.07192557 0.45654677 -0.55727629 -1.48176821
[91] -0.13126593 0.38024903 -0.13484917 1.89944058 0.79694484 1.36098009
[97] -1.02558046 -0.30139735 -0.87332860 0.69984601
> colSums(tmp)
[1] 0.02130937 -0.91641372 1.86211396 1.55787533 0.44628552 -1.06798907
[7] 0.13395170 -0.70774490 -0.24961314 -0.58280212 1.55986240 -0.24932970
[13] 0.28952198 0.10612284 0.95021485 -0.31350270 -0.04399344 1.33204053
[19] 0.41631027 -0.17264587 -0.79223044 0.51866163 2.19260409 0.86595735
[25] 1.01868336 -0.57018015 0.25250128 1.13588504 -0.39441858 0.15746474
[31] 0.91428394 -0.64277981 -0.62764247 1.40093438 0.08106506 2.39896533
[37] -0.11864038 -0.16917905 1.53215217 -1.68508796 -0.42979956 0.01878607
[43] 0.18258156 0.32931903 0.58614838 0.54195617 0.09868817 0.02152417
[49] 0.60738146 1.14970045 0.30136579 0.84397975 1.89784363 0.84975101
[55] -0.45069350 -1.53156394 0.17755147 0.50601468 -0.66713260 -0.84648411
[61] 0.89900079 0.08841236 -0.30239512 -0.39098673 0.85871312 -0.33050989
[67] 1.89785277 0.57155190 -1.47549713 0.31659351 1.05555150 0.95640578
[73] -2.05096137 1.01439482 0.10197020 -1.51364697 -0.35155399 1.62392302
[79] 1.17893759 0.02138937 0.16211315 1.12035310 -1.72436155 1.10381822
[85] 0.32852923 1.09613532 0.07192557 0.45654677 -0.55727629 -1.48176821
[91] -0.13126593 0.38024903 -0.13484917 1.89944058 0.79694484 1.36098009
[97] -1.02558046 -0.30139735 -0.87332860 0.69984601
> 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.02130937 -0.91641372 1.86211396 1.55787533 0.44628552 -1.06798907
[7] 0.13395170 -0.70774490 -0.24961314 -0.58280212 1.55986240 -0.24932970
[13] 0.28952198 0.10612284 0.95021485 -0.31350270 -0.04399344 1.33204053
[19] 0.41631027 -0.17264587 -0.79223044 0.51866163 2.19260409 0.86595735
[25] 1.01868336 -0.57018015 0.25250128 1.13588504 -0.39441858 0.15746474
[31] 0.91428394 -0.64277981 -0.62764247 1.40093438 0.08106506 2.39896533
[37] -0.11864038 -0.16917905 1.53215217 -1.68508796 -0.42979956 0.01878607
[43] 0.18258156 0.32931903 0.58614838 0.54195617 0.09868817 0.02152417
[49] 0.60738146 1.14970045 0.30136579 0.84397975 1.89784363 0.84975101
[55] -0.45069350 -1.53156394 0.17755147 0.50601468 -0.66713260 -0.84648411
[61] 0.89900079 0.08841236 -0.30239512 -0.39098673 0.85871312 -0.33050989
[67] 1.89785277 0.57155190 -1.47549713 0.31659351 1.05555150 0.95640578
[73] -2.05096137 1.01439482 0.10197020 -1.51364697 -0.35155399 1.62392302
[79] 1.17893759 0.02138937 0.16211315 1.12035310 -1.72436155 1.10381822
[85] 0.32852923 1.09613532 0.07192557 0.45654677 -0.55727629 -1.48176821
[91] -0.13126593 0.38024903 -0.13484917 1.89944058 0.79694484 1.36098009
[97] -1.02558046 -0.30139735 -0.87332860 0.69984601
> colMin(tmp)
[1] 0.02130937 -0.91641372 1.86211396 1.55787533 0.44628552 -1.06798907
[7] 0.13395170 -0.70774490 -0.24961314 -0.58280212 1.55986240 -0.24932970
[13] 0.28952198 0.10612284 0.95021485 -0.31350270 -0.04399344 1.33204053
[19] 0.41631027 -0.17264587 -0.79223044 0.51866163 2.19260409 0.86595735
[25] 1.01868336 -0.57018015 0.25250128 1.13588504 -0.39441858 0.15746474
[31] 0.91428394 -0.64277981 -0.62764247 1.40093438 0.08106506 2.39896533
[37] -0.11864038 -0.16917905 1.53215217 -1.68508796 -0.42979956 0.01878607
[43] 0.18258156 0.32931903 0.58614838 0.54195617 0.09868817 0.02152417
[49] 0.60738146 1.14970045 0.30136579 0.84397975 1.89784363 0.84975101
[55] -0.45069350 -1.53156394 0.17755147 0.50601468 -0.66713260 -0.84648411
[61] 0.89900079 0.08841236 -0.30239512 -0.39098673 0.85871312 -0.33050989
[67] 1.89785277 0.57155190 -1.47549713 0.31659351 1.05555150 0.95640578
[73] -2.05096137 1.01439482 0.10197020 -1.51364697 -0.35155399 1.62392302
[79] 1.17893759 0.02138937 0.16211315 1.12035310 -1.72436155 1.10381822
[85] 0.32852923 1.09613532 0.07192557 0.45654677 -0.55727629 -1.48176821
[91] -0.13126593 0.38024903 -0.13484917 1.89944058 0.79694484 1.36098009
[97] -1.02558046 -0.30139735 -0.87332860 0.69984601
> colMedians(tmp)
[1] 0.02130937 -0.91641372 1.86211396 1.55787533 0.44628552 -1.06798907
[7] 0.13395170 -0.70774490 -0.24961314 -0.58280212 1.55986240 -0.24932970
[13] 0.28952198 0.10612284 0.95021485 -0.31350270 -0.04399344 1.33204053
[19] 0.41631027 -0.17264587 -0.79223044 0.51866163 2.19260409 0.86595735
[25] 1.01868336 -0.57018015 0.25250128 1.13588504 -0.39441858 0.15746474
[31] 0.91428394 -0.64277981 -0.62764247 1.40093438 0.08106506 2.39896533
[37] -0.11864038 -0.16917905 1.53215217 -1.68508796 -0.42979956 0.01878607
[43] 0.18258156 0.32931903 0.58614838 0.54195617 0.09868817 0.02152417
[49] 0.60738146 1.14970045 0.30136579 0.84397975 1.89784363 0.84975101
[55] -0.45069350 -1.53156394 0.17755147 0.50601468 -0.66713260 -0.84648411
[61] 0.89900079 0.08841236 -0.30239512 -0.39098673 0.85871312 -0.33050989
[67] 1.89785277 0.57155190 -1.47549713 0.31659351 1.05555150 0.95640578
[73] -2.05096137 1.01439482 0.10197020 -1.51364697 -0.35155399 1.62392302
[79] 1.17893759 0.02138937 0.16211315 1.12035310 -1.72436155 1.10381822
[85] 0.32852923 1.09613532 0.07192557 0.45654677 -0.55727629 -1.48176821
[91] -0.13126593 0.38024903 -0.13484917 1.89944058 0.79694484 1.36098009
[97] -1.02558046 -0.30139735 -0.87332860 0.69984601
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.02130937 -0.9164137 1.862114 1.557875 0.4462855 -1.067989 0.1339517
[2,] 0.02130937 -0.9164137 1.862114 1.557875 0.4462855 -1.067989 0.1339517
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.7077449 -0.2496131 -0.5828021 1.559862 -0.2493297 0.289522 0.1061228
[2,] -0.7077449 -0.2496131 -0.5828021 1.559862 -0.2493297 0.289522 0.1061228
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.9502149 -0.3135027 -0.04399344 1.332041 0.4163103 -0.1726459 -0.7922304
[2,] 0.9502149 -0.3135027 -0.04399344 1.332041 0.4163103 -0.1726459 -0.7922304
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.5186616 2.192604 0.8659573 1.018683 -0.5701801 0.2525013 1.135885
[2,] 0.5186616 2.192604 0.8659573 1.018683 -0.5701801 0.2525013 1.135885
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.3944186 0.1574647 0.9142839 -0.6427798 -0.6276425 1.400934 0.08106506
[2,] -0.3944186 0.1574647 0.9142839 -0.6427798 -0.6276425 1.400934 0.08106506
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 2.398965 -0.1186404 -0.1691791 1.532152 -1.685088 -0.4297996 0.01878607
[2,] 2.398965 -0.1186404 -0.1691791 1.532152 -1.685088 -0.4297996 0.01878607
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.1825816 0.329319 0.5861484 0.5419562 0.09868817 0.02152417 0.6073815
[2,] 0.1825816 0.329319 0.5861484 0.5419562 0.09868817 0.02152417 0.6073815
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 1.1497 0.3013658 0.8439798 1.897844 0.849751 -0.4506935 -1.531564
[2,] 1.1497 0.3013658 0.8439798 1.897844 0.849751 -0.4506935 -1.531564
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.1775515 0.5060147 -0.6671326 -0.8464841 0.8990008 0.08841236 -0.3023951
[2,] 0.1775515 0.5060147 -0.6671326 -0.8464841 0.8990008 0.08841236 -0.3023951
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.3909867 0.8587131 -0.3305099 1.897853 0.5715519 -1.475497 0.3165935
[2,] -0.3909867 0.8587131 -0.3305099 1.897853 0.5715519 -1.475497 0.3165935
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 1.055551 0.9564058 -2.050961 1.014395 0.1019702 -1.513647 -0.351554
[2,] 1.055551 0.9564058 -2.050961 1.014395 0.1019702 -1.513647 -0.351554
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 1.623923 1.178938 0.02138937 0.1621132 1.120353 -1.724362 1.103818
[2,] 1.623923 1.178938 0.02138937 0.1621132 1.120353 -1.724362 1.103818
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 0.3285292 1.096135 0.07192557 0.4565468 -0.5572763 -1.481768 -0.1312659
[2,] 0.3285292 1.096135 0.07192557 0.4565468 -0.5572763 -1.481768 -0.1312659
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 0.380249 -0.1348492 1.899441 0.7969448 1.36098 -1.02558 -0.3013973
[2,] 0.380249 -0.1348492 1.899441 0.7969448 1.36098 -1.02558 -0.3013973
[,99] [,100]
[1,] -0.8733286 0.699846
[2,] -0.8733286 0.699846
>
>
> Max(tmp2)
[1] 2.413419
> Min(tmp2)
[1] -1.998134
> mean(tmp2)
[1] -0.07530286
> Sum(tmp2)
[1] -7.530286
> Var(tmp2)
[1] 0.8105996
>
> rowMeans(tmp2)
[1] -0.382340114 0.006741407 0.569594465 -0.732851657 0.455991568
[6] -1.358252989 -0.378636686 -0.215674135 -0.849953724 0.185041399
[11] 0.067356620 0.277455946 -0.028734481 -0.060157471 -1.076572384
[16] -0.248897975 -1.063013589 -0.982227952 0.469867121 -1.128834796
[21] 0.480268605 -0.033323142 1.333811602 -1.017461694 1.563189708
[26] -1.423352021 0.140898511 0.266016457 0.891375571 0.174279774
[31] -0.008629186 -0.943368957 -0.210070913 -1.998134052 -0.234275066
[36] 0.616793858 0.876883676 -0.505181607 1.193970036 -1.656884520
[41] 0.913826519 -0.073575928 0.384566735 -1.584040301 2.413419439
[46] -1.293980176 0.622687445 1.609593875 -1.215875848 -0.218102955
[51] -0.883277732 -1.879893039 -0.735449821 0.241260763 0.306313106
[56] -1.274299635 0.285158234 0.614739647 0.776256310 0.742506048
[61] 0.941915692 -0.042117084 -0.492931320 -0.604587576 0.199002308
[66] -0.790250665 1.268106206 -1.796308696 0.148762064 -0.634801920
[71] -0.350186263 1.004042613 0.458849939 -1.660637527 0.738071756
[76] 1.955368672 -0.297296388 -0.457060914 1.864843260 0.811024267
[81] -0.206784650 0.133361228 -0.583508175 -0.456492661 -0.941222840
[86] -0.651886378 -0.580758565 0.247223086 -0.045709176 -0.127340713
[91] 0.381178555 0.414383163 0.401576793 -1.107091752 -0.102349620
[96] 0.712924438 -0.491269685 -0.685359198 1.774017391 -0.663525302
> rowSums(tmp2)
[1] -0.382340114 0.006741407 0.569594465 -0.732851657 0.455991568
[6] -1.358252989 -0.378636686 -0.215674135 -0.849953724 0.185041399
[11] 0.067356620 0.277455946 -0.028734481 -0.060157471 -1.076572384
[16] -0.248897975 -1.063013589 -0.982227952 0.469867121 -1.128834796
[21] 0.480268605 -0.033323142 1.333811602 -1.017461694 1.563189708
[26] -1.423352021 0.140898511 0.266016457 0.891375571 0.174279774
[31] -0.008629186 -0.943368957 -0.210070913 -1.998134052 -0.234275066
[36] 0.616793858 0.876883676 -0.505181607 1.193970036 -1.656884520
[41] 0.913826519 -0.073575928 0.384566735 -1.584040301 2.413419439
[46] -1.293980176 0.622687445 1.609593875 -1.215875848 -0.218102955
[51] -0.883277732 -1.879893039 -0.735449821 0.241260763 0.306313106
[56] -1.274299635 0.285158234 0.614739647 0.776256310 0.742506048
[61] 0.941915692 -0.042117084 -0.492931320 -0.604587576 0.199002308
[66] -0.790250665 1.268106206 -1.796308696 0.148762064 -0.634801920
[71] -0.350186263 1.004042613 0.458849939 -1.660637527 0.738071756
[76] 1.955368672 -0.297296388 -0.457060914 1.864843260 0.811024267
[81] -0.206784650 0.133361228 -0.583508175 -0.456492661 -0.941222840
[86] -0.651886378 -0.580758565 0.247223086 -0.045709176 -0.127340713
[91] 0.381178555 0.414383163 0.401576793 -1.107091752 -0.102349620
[96] 0.712924438 -0.491269685 -0.685359198 1.774017391 -0.663525302
> 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.382340114 0.006741407 0.569594465 -0.732851657 0.455991568
[6] -1.358252989 -0.378636686 -0.215674135 -0.849953724 0.185041399
[11] 0.067356620 0.277455946 -0.028734481 -0.060157471 -1.076572384
[16] -0.248897975 -1.063013589 -0.982227952 0.469867121 -1.128834796
[21] 0.480268605 -0.033323142 1.333811602 -1.017461694 1.563189708
[26] -1.423352021 0.140898511 0.266016457 0.891375571 0.174279774
[31] -0.008629186 -0.943368957 -0.210070913 -1.998134052 -0.234275066
[36] 0.616793858 0.876883676 -0.505181607 1.193970036 -1.656884520
[41] 0.913826519 -0.073575928 0.384566735 -1.584040301 2.413419439
[46] -1.293980176 0.622687445 1.609593875 -1.215875848 -0.218102955
[51] -0.883277732 -1.879893039 -0.735449821 0.241260763 0.306313106
[56] -1.274299635 0.285158234 0.614739647 0.776256310 0.742506048
[61] 0.941915692 -0.042117084 -0.492931320 -0.604587576 0.199002308
[66] -0.790250665 1.268106206 -1.796308696 0.148762064 -0.634801920
[71] -0.350186263 1.004042613 0.458849939 -1.660637527 0.738071756
[76] 1.955368672 -0.297296388 -0.457060914 1.864843260 0.811024267
[81] -0.206784650 0.133361228 -0.583508175 -0.456492661 -0.941222840
[86] -0.651886378 -0.580758565 0.247223086 -0.045709176 -0.127340713
[91] 0.381178555 0.414383163 0.401576793 -1.107091752 -0.102349620
[96] 0.712924438 -0.491269685 -0.685359198 1.774017391 -0.663525302
> rowMin(tmp2)
[1] -0.382340114 0.006741407 0.569594465 -0.732851657 0.455991568
[6] -1.358252989 -0.378636686 -0.215674135 -0.849953724 0.185041399
[11] 0.067356620 0.277455946 -0.028734481 -0.060157471 -1.076572384
[16] -0.248897975 -1.063013589 -0.982227952 0.469867121 -1.128834796
[21] 0.480268605 -0.033323142 1.333811602 -1.017461694 1.563189708
[26] -1.423352021 0.140898511 0.266016457 0.891375571 0.174279774
[31] -0.008629186 -0.943368957 -0.210070913 -1.998134052 -0.234275066
[36] 0.616793858 0.876883676 -0.505181607 1.193970036 -1.656884520
[41] 0.913826519 -0.073575928 0.384566735 -1.584040301 2.413419439
[46] -1.293980176 0.622687445 1.609593875 -1.215875848 -0.218102955
[51] -0.883277732 -1.879893039 -0.735449821 0.241260763 0.306313106
[56] -1.274299635 0.285158234 0.614739647 0.776256310 0.742506048
[61] 0.941915692 -0.042117084 -0.492931320 -0.604587576 0.199002308
[66] -0.790250665 1.268106206 -1.796308696 0.148762064 -0.634801920
[71] -0.350186263 1.004042613 0.458849939 -1.660637527 0.738071756
[76] 1.955368672 -0.297296388 -0.457060914 1.864843260 0.811024267
[81] -0.206784650 0.133361228 -0.583508175 -0.456492661 -0.941222840
[86] -0.651886378 -0.580758565 0.247223086 -0.045709176 -0.127340713
[91] 0.381178555 0.414383163 0.401576793 -1.107091752 -0.102349620
[96] 0.712924438 -0.491269685 -0.685359198 1.774017391 -0.663525302
>
> colMeans(tmp2)
[1] -0.07530286
> colSums(tmp2)
[1] -7.530286
> colVars(tmp2)
[1] 0.8105996
> colSd(tmp2)
[1] 0.900333
> colMax(tmp2)
[1] 2.413419
> colMin(tmp2)
[1] -1.998134
> colMedians(tmp2)
[1] -0.05293332
> colRanges(tmp2)
[,1]
[1,] -1.998134
[2,] 2.413419
>
> 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] 4.77810768 2.56443540 1.86424106 -0.05336547 2.63350535 1.57142189
[7] 5.23055619 -1.52971578 -2.81368349 0.14668675
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.5801935
[2,] -0.1019080
[3,] 0.3371274
[4,] 0.8905617
[5,] 2.5166817
>
> rowApply(tmp,sum)
[1] -2.350822 -1.626213 5.054294 5.803449 6.835652 -2.161086 4.150728
[8] 4.355145 1.626255 -7.295212
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 6 5 10 4 5 1 7 9 8 7
[2,] 8 3 8 5 1 8 9 4 10 5
[3,] 7 8 1 8 6 10 5 8 7 2
[4,] 9 1 5 6 3 7 8 3 6 8
[5,] 3 7 2 7 8 9 6 1 9 10
[6,] 5 6 7 10 2 2 10 6 1 3
[7,] 10 9 4 2 9 4 4 10 3 9
[8,] 4 2 9 1 4 5 1 7 4 4
[9,] 2 4 6 3 10 3 2 2 2 6
[10,] 1 10 3 9 7 6 3 5 5 1
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 3.5860036 -1.1195326 1.0507028 -4.8183409 1.9003189 -1.8557699
[7] -2.2644766 0.6882289 1.7601174 0.0811381 1.4563552 -0.5046370
[13] -2.5673194 -1.4763017 1.7237372 1.1268569 -1.7077246 2.7283043
[19] -1.3999607 -0.7209947
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.2130385
[2,] 0.7960627
[3,] 0.8219021
[4,] 1.0853682
[5,] 1.0957091
>
> rowApply(tmp,sum)
[1] 4.036045 2.063288 2.547613 -5.008950 -5.971292
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 19 17 18 8 19
[2,] 6 13 8 2 12
[3,] 20 12 14 1 15
[4,] 10 2 4 13 2
[5,] 3 18 20 20 4
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1.0957091 -0.30154198 1.7624489 0.05419026 -0.7546641 -0.9737141
[2,] 0.7960627 0.57661818 0.5147885 -1.69419643 0.9269720 -0.4984098
[3,] 1.0853682 -0.07037012 0.3486791 -0.73713786 1.3964055 -0.7815193
[4,] -0.2130385 -1.43425863 -2.0585624 0.01542932 1.4968078 0.5463434
[5,] 0.8219021 0.11001993 0.4833487 -2.45662623 -1.1652022 -0.1484701
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.78616488 1.01207978 0.58115604 -0.5563321 0.4447366 -0.37457778
[2,] -2.17705591 1.08576247 0.66893467 0.2829633 -0.2329006 -0.07356773
[3,] -0.33846579 -0.02636065 -0.35945502 1.2579919 0.3144496 0.13077152
[4,] -0.01274921 -1.16067554 -0.01901442 -1.3400275 0.4885714 0.10949782
[5,] -0.52237062 -0.22257718 0.88849616 0.4365425 0.4414983 -0.29676084
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -1.5729674 -0.27949114 1.02670313 0.876135965 0.6777614 0.7984176
[2,] 1.2548148 -0.86594758 -0.62355891 0.385074528 0.4160142 0.7741720
[3,] -0.2188321 -0.98222643 0.55296143 0.008122575 -1.1802331 1.0679011
[4,] -1.0396035 -0.01788697 0.06366241 0.500241944 -1.1840984 -0.6293145
[5,] -0.9907311 0.66925046 0.70396915 -0.642718160 -0.4371688 0.7171282
[,19] [,20]
[1,] -0.20555771 -0.06061179
[2,] -0.20357831 0.75032623
[3,] 0.84264173 0.23692058
[4,] -0.06432096 0.94404675
[5,] -1.76914541 -2.59167652
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 653 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 -1.613773 -0.1320024 0.7879719 -2.702181 -0.01341889 -1.033312 0.7792418
col8 col9 col10 col11 col12 col13
row1 -0.2841118 -0.5366416 0.3670929 -0.04554056 -0.9814208 0.6665063
col14 col15 col16 col17 col18 col19 col20
row1 -0.4338424 -0.7449505 -0.107615 1.611785 -0.2919989 -2.577741 0.1921591
> tmp[,"col10"]
col10
row1 0.3670929
row2 -1.5062104
row3 -1.1490040
row4 1.5199186
row5 -0.6590130
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -1.6137728 -0.1320024 0.7879719 -2.70218120 -0.01341889 -1.033312
row5 0.2810942 1.1404490 -0.5406964 -0.02855981 0.60662141 -1.611542
col7 col8 col9 col10 col11 col12
row1 0.7792418 -0.2841118 -0.5366416 0.3670929 -0.04554056 -0.9814208
row5 0.7040955 0.6606479 0.3670589 -0.6590130 -0.93586687 -0.8821104
col13 col14 col15 col16 col17 col18 col19
row1 0.6665063 -0.4338424 -0.7449505 -0.107615 1.611785 -0.2919989 -2.5777411
row5 1.2461642 -1.5473192 -0.6051050 -0.777648 -1.117461 -1.0332106 0.7509638
col20
row1 0.1921591
row5 1.6142972
> tmp[,c("col6","col20")]
col6 col20
row1 -1.0333116 0.1921591
row2 0.7275324 1.6871417
row3 1.5923132 -0.9148914
row4 -0.9665272 0.4594312
row5 -1.6115423 1.6142972
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -1.033312 0.1921591
row5 -1.611542 1.6142972
>
>
>
>
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105)
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.89809 49.48299 51.28316 50.21842 49.50399 104.7073 50.40848 51.71874
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.49507 49.69753 49.87447 51.39491 50.50795 50.31166 50.8131 49.62133
col17 col18 col19 col20
row1 47.71277 50.37442 48.42127 105.087
> tmp[,"col10"]
col10
row1 49.69753
row2 30.26756
row3 30.26355
row4 30.24750
row5 50.15436
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.89809 49.48299 51.28316 50.21842 49.50399 104.7073 50.40848 51.71874
row5 49.23567 50.32134 49.94572 49.04075 49.54136 105.3382 50.08279 48.69893
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.49507 49.69753 49.87447 51.39491 50.50795 50.31166 50.81310 49.62133
row5 51.59099 50.15436 50.61951 48.02459 50.47863 50.42955 50.80021 49.21622
col17 col18 col19 col20
row1 47.71277 50.37442 48.42127 105.0870
row5 49.41002 50.49995 51.51961 104.5125
> tmp[,c("col6","col20")]
col6 col20
row1 104.70731 105.08702
row2 74.27977 74.67291
row3 74.57207 74.27751
row4 74.78593 75.34686
row5 105.33818 104.51253
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.7073 105.0870
row5 105.3382 104.5125
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.7073 105.0870
row5 105.3382 104.5125
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -1.7728030
[2,] 0.9523584
[3,] -0.3678743
[4,] 0.1562010
[5,] -1.8707753
> tmp[,c("col17","col7")]
col17 col7
[1,] -1.09079372 1.0383915
[2,] -0.98152792 0.5236887
[3,] 0.30233454 -0.5730707
[4,] -0.02277115 -0.5634838
[5,] -2.13304635 -1.6478657
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.3634048 -2.72655809
[2,] -0.4411377 -1.08122340
[3,] 0.3441874 -0.05778761
[4,] 0.5081646 1.14692322
[5,] -0.2927763 -0.87037236
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.3634048
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.3634048
[2,] -0.4411377
>
>
>
> 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.807467 0.1251941 0.7861939 0.1052407 2.4672204 -0.4731026 0.1910149
row1 1.432132 -0.6916714 1.3863594 0.8097726 0.2324317 -0.7857803 -0.4255443
[,8] [,9] [,10] [,11] [,12] [,13]
row3 1.1192471 0.88049674 -2.2034763 0.7093856 -0.5973446 0.2885669
row1 -0.7163788 0.07478265 0.4369316 -0.4750539 0.1742576 0.9706547
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row3 1.2842401 0.2708063 -0.09620846 -0.6204183 -1.896444 0.1258688 1.791092
row1 -0.7785003 0.7958023 -1.07765603 -0.3032172 0.299622 -0.4436870 1.415151
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.1331908 -1.088522 -0.3665468 -0.4702601 0.9479708 0.1990776 0.2394215
[,8] [,9] [,10]
row2 0.4861752 -0.3683462 -0.4187234
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.7181379 0.4638987 -1.022694 1.710183 -1.419181 -0.8248925 0.1297698
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.840334 -0.5845149 0.8439647 1.713627 1.955423 -0.6509489 0.3639789
[,15] [,16] [,17] [,18] [,19] [,20]
row5 2.213673 -0.4716059 -1.115354 -0.3278352 -0.08145126 0.4971046
>
>
> 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: 0x56f6b4a91450>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15f1744cfebf61"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15f1747a894be3"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15f17470d29bd1"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15f17456f457d0"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15f174638b37be"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15f17426eb7094"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15f174153dfc1b"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15f174588718d6"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15f1741577dc57"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15f17411b558b8"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15f17416313b9d"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15f17480683ae"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15f17419c51deb"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15f174e04ff87"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM15f17458e2872d"
>
>
> ### 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: 0x56f6b4d2ef10>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x56f6b4d2ef10>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x56f6b4d2ef10>
> rowMedians(tmp)
[1] -0.419449563 0.687438066 0.487226524 0.129207624 0.097609797
[6] 0.070099263 -0.337576792 0.050612225 -0.249754933 0.027008399
[11] -0.214410990 0.234099012 0.096908459 -0.377083200 -0.835340776
[16] 0.211850170 -0.028814648 -0.160544260 0.075858879 -0.263506380
[21] -0.337954604 0.051428556 0.007664767 -0.156318414 0.106786801
[26] 0.104449167 0.306068718 0.014015575 -0.580989715 0.058316136
[31] -0.016069674 0.190211272 -0.013167330 -0.238622434 -0.020791127
[36] -0.210090337 0.211127652 0.007248371 -0.110674971 -0.015494312
[41] 0.256604994 -0.421959000 -0.266760987 0.790979910 -0.300690195
[46] 0.153564243 0.260672333 -0.277750156 0.308771873 0.223785172
[51] 0.190842437 0.425549553 0.564778321 0.471082484 -0.383164354
[56] -0.148580177 -0.112518471 -0.064904528 -0.003762056 -0.317834846
[61] -0.492800684 0.304726502 0.183512141 -0.312675728 -0.115406962
[66] -0.925817385 -0.216237595 0.523622594 -0.127998699 -1.046780216
[71] -0.425643870 -0.281458022 -0.148912789 0.010600196 0.368219589
[76] 0.195876217 -0.155073198 -0.202557579 0.139677459 0.179220994
[81] 0.394373353 0.108831911 0.093387928 -0.377649612 -0.148589329
[86] -0.089125056 -0.177933763 -0.168354434 -0.183201715 0.123866517
[91] 0.074597872 0.084149425 0.114163520 -0.349102489 0.079646380
[96] 0.379528840 0.167050792 -0.506050217 -0.088667240 0.292203512
[101] 0.633378773 -0.188412024 -0.126795438 0.602255726 0.013990747
[106] -0.137032925 0.054894552 0.255056985 -0.259908653 -0.320354562
[111] -0.100771975 0.431127334 -0.158937424 0.105312762 -0.057080625
[116] 0.306070754 -0.026609924 -0.064235333 0.295186002 0.136899173
[121] -0.243333973 -0.268791476 -0.101302883 -0.269336952 -0.080223848
[126] 0.272972960 -0.037260531 -0.056842012 0.743732294 -0.167527546
[131] 0.211305908 -0.142390328 -0.195206105 -0.384299504 -0.028249619
[136] -0.047361823 -0.160988811 -0.234578672 0.014997377 -0.075599945
[141] -0.001090192 0.271972723 0.696701052 0.494687271 -0.454559324
[146] -0.232900713 0.590001690 0.008515171 0.232319574 -0.689857964
[151] -0.243282138 -0.060671908 -0.771635929 0.136725805 -0.097922860
[156] 0.291180240 0.094748378 0.097117143 -0.381730623 0.189682714
[161] 0.063768129 -0.294655056 0.200683910 0.085478212 0.360160917
[166] 0.632356924 0.174510925 -0.442588464 0.257659372 -0.383333298
[171] -0.041017877 -0.015118158 0.164964585 0.533683518 0.583261736
[176] 0.484090474 0.124593454 0.401019165 -0.221016887 -0.283722638
[181] -0.017470309 -0.743386291 0.714072286 -0.018494567 -0.636462364
[186] 0.346986659 -0.169406278 0.242243185 0.318631250 -0.157174109
[191] 0.193473140 -0.135394506 -0.175611509 -0.079604435 -0.463811823
[196] -0.039711939 0.216540876 0.277719653 0.107222964 -0.060042118
[201] -0.184539240 -0.150292653 0.048523895 -0.458947867 -0.012181379
[206] 0.503100469 -0.047230623 0.073401673 0.365717408 -0.605215600
[211] -0.217956711 0.327522414 -0.523792025 0.117360576 -0.355575185
[216] -0.025995303 -0.025391073 -0.087995687 -0.143277071 0.048753022
[221] -0.405461036 -0.043615903 0.196654485 0.370720002 0.140851229
[226] -0.793502082 0.289626198 -0.003935531 0.015164096 0.042113306
>
> proc.time()
user system elapsed
1.386 1.462 2.835
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: 0x6117f627fc10>
> .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: 0x6117f627fc10>
> .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: 0x6117f627fc10>
> .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: 0x6117f627fc10>
> 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: 0x6117f6f422d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6117f6f422d0>
> .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: 0x6117f6f422d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6117f6f422d0>
> .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: 0x6117f6f422d0>
> 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: 0x6117f7617d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6117f7617d70>
> .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: 0x6117f7617d70>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6117f7617d70>
> .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: 0x6117f7617d70>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x6117f7617d70>
> .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: 0x6117f7617d70>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x6117f7617d70>
> .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: 0x6117f7617d70>
> 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: 0x6117f718b370>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6117f718b370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6117f718b370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6117f718b370>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile15f2611d4d50ca" "BufferedMatrixFile15f261347b5de7"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile15f2611d4d50ca" "BufferedMatrixFile15f261347b5de7"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6117f70d6ff0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6117f70d6ff0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6117f70d6ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6117f70d6ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6117f70d6ff0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6117f70d6ff0>
> .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: 0x6117f72b93d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6117f72b93d0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6117f72b93d0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6117f72b93d0>
> 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: 0x6117f8a6afb0>
> .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: 0x6117f8a6afb0>
> rm(P)
>
> proc.time()
user system elapsed
0.285 0.046 0.318
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100 0
> buffer.dim(Temp)
[1] 1 1
>
>
> proc.time()
user system elapsed
0.248 0.046 0.282