| Back to Build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-02-24 11:32 -0500 (Tue, 24 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" | 4872 |
| 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/2354 | 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-23 21:49:28 -0500 (Mon, 23 Feb 2026) |
| EndedAt: 2026-02-23 21:49:53 -0500 (Mon, 23 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.254 0.039 0.281
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 23 21:49:43 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 23 21:49:43 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: 0x5deace71bc10>
>
>
>
> 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 23 21:49:43 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 23 21:49:43 2026"
>
> ColMode(tmp2)
<pointer: 0x5deace71bc10>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.4001566 -0.32813324 0.04701931 1.7437198
[2,] -0.2075766 0.31874281 -0.79383972 -0.4155965
[3,] -0.6597113 0.01313418 -1.65861502 0.2490013
[4,] 0.3540224 0.10355495 -0.07162863 1.7461709
> 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,] 100.4001566 0.32813324 0.04701931 1.7437198
[2,] 0.2075766 0.31874281 0.79383972 0.4155965
[3,] 0.6597113 0.01313418 1.65861502 0.2490013
[4,] 0.3540224 0.10355495 0.07162863 1.7461709
> 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,] 10.0199879 0.5728292 0.2168394 1.3204998
[2,] 0.4556058 0.5645731 0.8909768 0.6446678
[3,] 0.8122261 0.1146044 1.2878723 0.4990003
[4,] 0.5949979 0.3217996 0.2676353 1.3214276
>
> 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,] 225.60004 31.05642 27.21541 39.94872
[2,] 29.76363 30.96447 34.70361 31.86227
[3,] 33.78197 26.15918 39.53734 30.23900
[4,] 31.30400 28.32155 27.74798 39.96045
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5deacf572ff0>
> exp(tmp5)
<pointer: 0x5deacf572ff0>
> log(tmp5,2)
<pointer: 0x5deacf572ff0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.5569
> Min(tmp5)
[1] 53.23002
> mean(tmp5)
[1] 72.5847
> Sum(tmp5)
[1] 14516.94
> Var(tmp5)
[1] 865.4817
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.77028 68.57802 70.14170 71.41914 68.94849 69.49723 73.67411 70.90869
[9] 72.11622 69.79308
> rowSums(tmp5)
[1] 1815.406 1371.560 1402.834 1428.383 1378.970 1389.945 1473.482 1418.174
[9] 1442.324 1395.862
> rowVars(tmp5)
[1] 8035.41313 46.84522 79.70146 80.22430 62.64205 75.88467
[7] 66.61251 65.92235 78.81339 63.39816
> rowSd(tmp5)
[1] 89.640466 6.844357 8.927567 8.956802 7.914673 8.711181 8.161648
[8] 8.119258 8.877691 7.962296
> rowMax(tmp5)
[1] 469.55692 83.87394 82.83889 85.78693 85.77032 83.98433 85.59975
[8] 83.54900 90.67486 87.26675
> rowMin(tmp5)
[1] 56.64532 58.34898 54.44690 57.75379 54.99330 53.23002 59.25956 58.62819
[9] 58.84506 60.86165
>
> colMeans(tmp5)
[1] 111.79791 65.76363 67.94934 70.05439 71.62612 69.25746 73.31412
[8] 66.87449 75.20668 70.44664 71.57897 72.10778 68.21330 69.74153
[15] 76.55627 70.89274 71.01475 70.86212 68.52139 69.91429
> colSums(tmp5)
[1] 1117.9791 657.6363 679.4934 700.5439 716.2612 692.5746 733.1412
[8] 668.7449 752.0668 704.4664 715.7897 721.0778 682.1330 697.4153
[15] 765.5627 708.9274 710.1475 708.6212 685.2139 699.1429
> colVars(tmp5)
[1] 15898.42885 58.87871 112.58035 53.03953 70.57620 65.74275
[7] 81.22560 38.67354 77.31166 79.50391 58.75524 73.98143
[13] 68.74383 81.58492 42.80803 58.29237 116.80124 71.54494
[19] 34.25736 55.35625
> colSd(tmp5)
[1] 126.088972 7.673246 10.610389 7.282824 8.400964 8.108191
[7] 9.012525 6.218805 8.792705 8.916496 7.665197 8.601246
[13] 8.291190 9.032437 6.542785 7.634944 10.807462 8.458424
[19] 5.852978 7.440178
> colMax(tmp5)
[1] 469.55692 79.92513 82.29179 83.17243 85.45492 80.89932 85.59975
[8] 79.64993 90.45782 82.42970 85.78693 84.85425 82.41387 79.53295
[15] 87.26675 83.86491 82.83889 83.54900 79.58834 81.58644
> colMin(tmp5)
[1] 61.94911 54.44690 56.64532 62.93853 59.93632 58.62819 58.34898 59.02443
[9] 60.69318 54.99330 61.14881 62.10389 58.04275 57.64502 68.28253 60.57864
[17] 53.23002 59.51593 60.68175 58.69835
>
>
> ### 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] 90.77028 68.57802 70.14170 71.41914 68.94849 69.49723 NA 70.90869
[9] 72.11622 69.79308
> rowSums(tmp5)
[1] 1815.406 1371.560 1402.834 1428.383 1378.970 1389.945 NA 1418.174
[9] 1442.324 1395.862
> rowVars(tmp5)
[1] 8035.41313 46.84522 79.70146 80.22430 62.64205 75.88467
[7] 70.31257 65.92235 78.81339 63.39816
> rowSd(tmp5)
[1] 89.640466 6.844357 8.927567 8.956802 7.914673 8.711181 8.385259
[8] 8.119258 8.877691 7.962296
> rowMax(tmp5)
[1] 469.55692 83.87394 82.83889 85.78693 85.77032 83.98433 NA
[8] 83.54900 90.67486 87.26675
> rowMin(tmp5)
[1] 56.64532 58.34898 54.44690 57.75379 54.99330 53.23002 NA 58.62819
[9] 58.84506 60.86165
>
> colMeans(tmp5)
[1] 111.79791 65.76363 67.94934 70.05439 71.62612 69.25746 73.31412
[8] 66.87449 75.20668 70.44664 71.57897 72.10778 68.21330 69.74153
[15] 76.55627 NA 71.01475 70.86212 68.52139 69.91429
> colSums(tmp5)
[1] 1117.9791 657.6363 679.4934 700.5439 716.2612 692.5746 733.1412
[8] 668.7449 752.0668 704.4664 715.7897 721.0778 682.1330 697.4153
[15] 765.5627 NA 710.1475 708.6212 685.2139 699.1429
> colVars(tmp5)
[1] 15898.42885 58.87871 112.58035 53.03953 70.57620 65.74275
[7] 81.22560 38.67354 77.31166 79.50391 58.75524 73.98143
[13] 68.74383 81.58492 42.80803 NA 116.80124 71.54494
[19] 34.25736 55.35625
> colSd(tmp5)
[1] 126.088972 7.673246 10.610389 7.282824 8.400964 8.108191
[7] 9.012525 6.218805 8.792705 8.916496 7.665197 8.601246
[13] 8.291190 9.032437 6.542785 NA 10.807462 8.458424
[19] 5.852978 7.440178
> colMax(tmp5)
[1] 469.55692 79.92513 82.29179 83.17243 85.45492 80.89932 85.59975
[8] 79.64993 90.45782 82.42970 85.78693 84.85425 82.41387 79.53295
[15] 87.26675 NA 82.83889 83.54900 79.58834 81.58644
> colMin(tmp5)
[1] 61.94911 54.44690 56.64532 62.93853 59.93632 58.62819 58.34898 59.02443
[9] 60.69318 54.99330 61.14881 62.10389 58.04275 57.64502 68.28253 NA
[17] 53.23002 59.51593 60.68175 58.69835
>
> Max(tmp5,na.rm=TRUE)
[1] 469.5569
> Min(tmp5,na.rm=TRUE)
[1] 53.23002
> mean(tmp5,na.rm=TRUE)
[1] 72.57974
> Sum(tmp5,na.rm=TRUE)
[1] 14443.37
> Var(tmp5,na.rm=TRUE)
[1] 869.8479
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.77028 68.57802 70.14170 71.41914 68.94849 69.49723 73.67957 70.90869
[9] 72.11622 69.79308
> rowSums(tmp5,na.rm=TRUE)
[1] 1815.406 1371.560 1402.834 1428.383 1378.970 1389.945 1399.912 1418.174
[9] 1442.324 1395.862
> rowVars(tmp5,na.rm=TRUE)
[1] 8035.41313 46.84522 79.70146 80.22430 62.64205 75.88467
[7] 70.31257 65.92235 78.81339 63.39816
> rowSd(tmp5,na.rm=TRUE)
[1] 89.640466 6.844357 8.927567 8.956802 7.914673 8.711181 8.385259
[8] 8.119258 8.877691 7.962296
> rowMax(tmp5,na.rm=TRUE)
[1] 469.55692 83.87394 82.83889 85.78693 85.77032 83.98433 85.59975
[8] 83.54900 90.67486 87.26675
> rowMin(tmp5,na.rm=TRUE)
[1] 56.64532 58.34898 54.44690 57.75379 54.99330 53.23002 59.25956 58.62819
[9] 58.84506 60.86165
>
> colMeans(tmp5,na.rm=TRUE)
[1] 111.79791 65.76363 67.94934 70.05439 71.62612 69.25746 73.31412
[8] 66.87449 75.20668 70.44664 71.57897 72.10778 68.21330 69.74153
[15] 76.55627 70.59524 71.01475 70.86212 68.52139 69.91429
> colSums(tmp5,na.rm=TRUE)
[1] 1117.9791 657.6363 679.4934 700.5439 716.2612 692.5746 733.1412
[8] 668.7449 752.0668 704.4664 715.7897 721.0778 682.1330 697.4153
[15] 765.5627 635.3572 710.1475 708.6212 685.2139 699.1429
> colVars(tmp5,na.rm=TRUE)
[1] 15898.42885 58.87871 112.58035 53.03953 70.57620 65.74275
[7] 81.22560 38.67354 77.31166 79.50391 58.75524 73.98143
[13] 68.74383 81.58492 42.80803 64.58323 116.80124 71.54494
[19] 34.25736 55.35625
> colSd(tmp5,na.rm=TRUE)
[1] 126.088972 7.673246 10.610389 7.282824 8.400964 8.108191
[7] 9.012525 6.218805 8.792705 8.916496 7.665197 8.601246
[13] 8.291190 9.032437 6.542785 8.036369 10.807462 8.458424
[19] 5.852978 7.440178
> colMax(tmp5,na.rm=TRUE)
[1] 469.55692 79.92513 82.29179 83.17243 85.45492 80.89932 85.59975
[8] 79.64993 90.45782 82.42970 85.78693 84.85425 82.41387 79.53295
[15] 87.26675 83.86491 82.83889 83.54900 79.58834 81.58644
> colMin(tmp5,na.rm=TRUE)
[1] 61.94911 54.44690 56.64532 62.93853 59.93632 58.62819 58.34898 59.02443
[9] 60.69318 54.99330 61.14881 62.10389 58.04275 57.64502 68.28253 60.57864
[17] 53.23002 59.51593 60.68175 58.69835
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.77028 68.57802 70.14170 71.41914 68.94849 69.49723 NaN 70.90869
[9] 72.11622 69.79308
> rowSums(tmp5,na.rm=TRUE)
[1] 1815.406 1371.560 1402.834 1428.383 1378.970 1389.945 0.000 1418.174
[9] 1442.324 1395.862
> rowVars(tmp5,na.rm=TRUE)
[1] 8035.41313 46.84522 79.70146 80.22430 62.64205 75.88467
[7] NA 65.92235 78.81339 63.39816
> rowSd(tmp5,na.rm=TRUE)
[1] 89.640466 6.844357 8.927567 8.956802 7.914673 8.711181 NA
[8] 8.119258 8.877691 7.962296
> rowMax(tmp5,na.rm=TRUE)
[1] 469.55692 83.87394 82.83889 85.78693 85.77032 83.98433 NA
[8] 83.54900 90.67486 87.26675
> rowMin(tmp5,na.rm=TRUE)
[1] 56.64532 58.34898 54.44690 57.75379 54.99330 53.23002 NA 58.62819
[9] 58.84506 60.86165
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 114.84107 64.61416 66.38180 69.88533 70.08959 69.99242 71.94905
[8] 67.48131 75.49344 70.31758 72.69736 72.39301 69.20816 69.07068
[15] 77.44359 NaN 70.72158 70.18852 67.29173 68.61738
> colSums(tmp5,na.rm=TRUE)
[1] 1033.5697 581.5275 597.4362 628.9680 630.8063 629.9318 647.5414
[8] 607.3318 679.4410 632.8582 654.2763 651.5371 622.8734 621.6361
[15] 696.9923 0.0000 636.4942 631.6967 605.6256 617.5565
> colVars(tmp5,na.rm=TRUE)
[1] 17781.54817 51.37415 99.00971 59.34792 52.83771 67.88373
[7] 70.41537 39.36511 86.05050 89.25451 52.02808 82.31385
[13] 66.20216 86.72001 39.30146 NA 130.43446 75.38347
[19] 21.52878 43.35367
> colSd(tmp5,na.rm=TRUE)
[1] 133.347472 7.167576 9.950362 7.703760 7.268955 8.239158
[7] 8.391387 6.274162 9.276341 9.447460 7.213049 9.072698
[13] 8.136471 9.312358 6.269087 NA 11.420791 8.682365
[19] 4.639911 6.584351
> colMax(tmp5,na.rm=TRUE)
[1] 469.55692 79.92513 82.29179 83.17243 80.67130 80.89932 80.36644
[8] 79.64993 90.45782 82.42970 85.78693 84.85425 82.41387 79.53295
[15] 87.26675 -Inf 82.83889 83.54900 74.83708 75.72324
> colMin(tmp5,na.rm=TRUE)
[1] 61.94911 54.44690 56.64532 62.93853 59.93632 58.62819 58.34898 59.02443
[9] 60.69318 54.99330 61.14881 62.10389 58.04275 57.64502 68.28253 Inf
[17] 53.23002 59.51593 60.68175 58.69835
>
>
>
>
> 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] 186.7354 245.8362 174.0978 225.2852 125.9464 130.0235 234.3087 219.9483
[9] 229.3548 189.5320
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 186.7354 245.8362 174.0978 225.2852 125.9464 130.0235 234.3087 219.9483
[9] 229.3548 189.5320
>
>
>
> 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] -5.684342e-14 0.000000e+00 3.410605e-13 8.526513e-14 2.273737e-13
[6] -5.684342e-14 2.842171e-14 8.526513e-14 0.000000e+00 2.273737e-13
[11] 1.136868e-13 2.842171e-14 -8.526513e-14 2.842171e-14 0.000000e+00
[16] -1.705303e-13 -2.842171e-14 0.000000e+00 1.421085e-13 -9.947598e-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)
+ }
6 10
9 12
8 7
1 1
2 7
5 5
6 3
10 7
7 9
6 13
9 1
5 11
2 17
7 3
6 17
3 8
3 3
1 13
5 16
10 18
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 2.587312
> Min(tmp)
[1] -2.911752
> mean(tmp)
[1] 0.07931723
> Sum(tmp)
[1] 7.931723
> Var(tmp)
[1] 0.9822641
>
> rowMeans(tmp)
[1] 0.07931723
> rowSums(tmp)
[1] 7.931723
> rowVars(tmp)
[1] 0.9822641
> rowSd(tmp)
[1] 0.9910924
> rowMax(tmp)
[1] 2.587312
> rowMin(tmp)
[1] -2.911752
>
> colMeans(tmp)
[1] -0.461606875 -1.775760072 1.295713893 -0.707012456 0.920060495
[6] 1.395083178 -0.302102592 0.325922399 -0.801437926 1.608640791
[11] 1.209286435 1.186031054 0.028550533 -1.169162764 0.616657094
[16] -0.340751844 -0.841684491 0.022906802 0.090824097 1.033512112
[21] -0.108880869 0.757316131 -0.035983149 0.990715665 0.981503809
[26] 0.575737395 -1.442264018 -0.006672274 -0.840097705 -2.124336435
[31] 1.257154569 -1.429447204 -0.533504810 1.278925017 0.002543604
[36] 1.011339774 0.026050029 -0.043127993 0.512041320 -0.301762725
[41] 0.252530052 -0.440766631 -0.192082224 -2.911752195 -0.508627221
[46] 0.089942192 1.742819228 2.587312183 0.712479640 -0.150106731
[51] 0.407041857 1.191114683 -1.485252859 -1.143979011 -0.375213491
[56] 0.445538410 1.737969997 -1.153229138 0.671823931 1.007769441
[61] 0.158384153 -0.856480082 -0.287661038 0.418210833 -0.065526192
[66] 1.209255742 -1.155386612 -0.809974364 0.654253808 1.337300892
[71] 0.820642118 -0.428663958 -0.058022905 0.846021470 -0.840164635
[76] -2.145876596 -1.318887584 -0.128645552 -0.799613060 1.040008279
[81] -1.106782592 -0.425654152 0.972404483 -0.446671237 1.042690487
[86] -0.620534798 1.303924182 1.147135243 0.867611801 -1.060198771
[91] 0.848756794 1.337845061 0.258931385 0.058960500 -1.521445353
[96] 0.210192665 0.690863151 -0.361998348 0.632873142 0.167392522
> colSums(tmp)
[1] -0.461606875 -1.775760072 1.295713893 -0.707012456 0.920060495
[6] 1.395083178 -0.302102592 0.325922399 -0.801437926 1.608640791
[11] 1.209286435 1.186031054 0.028550533 -1.169162764 0.616657094
[16] -0.340751844 -0.841684491 0.022906802 0.090824097 1.033512112
[21] -0.108880869 0.757316131 -0.035983149 0.990715665 0.981503809
[26] 0.575737395 -1.442264018 -0.006672274 -0.840097705 -2.124336435
[31] 1.257154569 -1.429447204 -0.533504810 1.278925017 0.002543604
[36] 1.011339774 0.026050029 -0.043127993 0.512041320 -0.301762725
[41] 0.252530052 -0.440766631 -0.192082224 -2.911752195 -0.508627221
[46] 0.089942192 1.742819228 2.587312183 0.712479640 -0.150106731
[51] 0.407041857 1.191114683 -1.485252859 -1.143979011 -0.375213491
[56] 0.445538410 1.737969997 -1.153229138 0.671823931 1.007769441
[61] 0.158384153 -0.856480082 -0.287661038 0.418210833 -0.065526192
[66] 1.209255742 -1.155386612 -0.809974364 0.654253808 1.337300892
[71] 0.820642118 -0.428663958 -0.058022905 0.846021470 -0.840164635
[76] -2.145876596 -1.318887584 -0.128645552 -0.799613060 1.040008279
[81] -1.106782592 -0.425654152 0.972404483 -0.446671237 1.042690487
[86] -0.620534798 1.303924182 1.147135243 0.867611801 -1.060198771
[91] 0.848756794 1.337845061 0.258931385 0.058960500 -1.521445353
[96] 0.210192665 0.690863151 -0.361998348 0.632873142 0.167392522
> 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.461606875 -1.775760072 1.295713893 -0.707012456 0.920060495
[6] 1.395083178 -0.302102592 0.325922399 -0.801437926 1.608640791
[11] 1.209286435 1.186031054 0.028550533 -1.169162764 0.616657094
[16] -0.340751844 -0.841684491 0.022906802 0.090824097 1.033512112
[21] -0.108880869 0.757316131 -0.035983149 0.990715665 0.981503809
[26] 0.575737395 -1.442264018 -0.006672274 -0.840097705 -2.124336435
[31] 1.257154569 -1.429447204 -0.533504810 1.278925017 0.002543604
[36] 1.011339774 0.026050029 -0.043127993 0.512041320 -0.301762725
[41] 0.252530052 -0.440766631 -0.192082224 -2.911752195 -0.508627221
[46] 0.089942192 1.742819228 2.587312183 0.712479640 -0.150106731
[51] 0.407041857 1.191114683 -1.485252859 -1.143979011 -0.375213491
[56] 0.445538410 1.737969997 -1.153229138 0.671823931 1.007769441
[61] 0.158384153 -0.856480082 -0.287661038 0.418210833 -0.065526192
[66] 1.209255742 -1.155386612 -0.809974364 0.654253808 1.337300892
[71] 0.820642118 -0.428663958 -0.058022905 0.846021470 -0.840164635
[76] -2.145876596 -1.318887584 -0.128645552 -0.799613060 1.040008279
[81] -1.106782592 -0.425654152 0.972404483 -0.446671237 1.042690487
[86] -0.620534798 1.303924182 1.147135243 0.867611801 -1.060198771
[91] 0.848756794 1.337845061 0.258931385 0.058960500 -1.521445353
[96] 0.210192665 0.690863151 -0.361998348 0.632873142 0.167392522
> colMin(tmp)
[1] -0.461606875 -1.775760072 1.295713893 -0.707012456 0.920060495
[6] 1.395083178 -0.302102592 0.325922399 -0.801437926 1.608640791
[11] 1.209286435 1.186031054 0.028550533 -1.169162764 0.616657094
[16] -0.340751844 -0.841684491 0.022906802 0.090824097 1.033512112
[21] -0.108880869 0.757316131 -0.035983149 0.990715665 0.981503809
[26] 0.575737395 -1.442264018 -0.006672274 -0.840097705 -2.124336435
[31] 1.257154569 -1.429447204 -0.533504810 1.278925017 0.002543604
[36] 1.011339774 0.026050029 -0.043127993 0.512041320 -0.301762725
[41] 0.252530052 -0.440766631 -0.192082224 -2.911752195 -0.508627221
[46] 0.089942192 1.742819228 2.587312183 0.712479640 -0.150106731
[51] 0.407041857 1.191114683 -1.485252859 -1.143979011 -0.375213491
[56] 0.445538410 1.737969997 -1.153229138 0.671823931 1.007769441
[61] 0.158384153 -0.856480082 -0.287661038 0.418210833 -0.065526192
[66] 1.209255742 -1.155386612 -0.809974364 0.654253808 1.337300892
[71] 0.820642118 -0.428663958 -0.058022905 0.846021470 -0.840164635
[76] -2.145876596 -1.318887584 -0.128645552 -0.799613060 1.040008279
[81] -1.106782592 -0.425654152 0.972404483 -0.446671237 1.042690487
[86] -0.620534798 1.303924182 1.147135243 0.867611801 -1.060198771
[91] 0.848756794 1.337845061 0.258931385 0.058960500 -1.521445353
[96] 0.210192665 0.690863151 -0.361998348 0.632873142 0.167392522
> colMedians(tmp)
[1] -0.461606875 -1.775760072 1.295713893 -0.707012456 0.920060495
[6] 1.395083178 -0.302102592 0.325922399 -0.801437926 1.608640791
[11] 1.209286435 1.186031054 0.028550533 -1.169162764 0.616657094
[16] -0.340751844 -0.841684491 0.022906802 0.090824097 1.033512112
[21] -0.108880869 0.757316131 -0.035983149 0.990715665 0.981503809
[26] 0.575737395 -1.442264018 -0.006672274 -0.840097705 -2.124336435
[31] 1.257154569 -1.429447204 -0.533504810 1.278925017 0.002543604
[36] 1.011339774 0.026050029 -0.043127993 0.512041320 -0.301762725
[41] 0.252530052 -0.440766631 -0.192082224 -2.911752195 -0.508627221
[46] 0.089942192 1.742819228 2.587312183 0.712479640 -0.150106731
[51] 0.407041857 1.191114683 -1.485252859 -1.143979011 -0.375213491
[56] 0.445538410 1.737969997 -1.153229138 0.671823931 1.007769441
[61] 0.158384153 -0.856480082 -0.287661038 0.418210833 -0.065526192
[66] 1.209255742 -1.155386612 -0.809974364 0.654253808 1.337300892
[71] 0.820642118 -0.428663958 -0.058022905 0.846021470 -0.840164635
[76] -2.145876596 -1.318887584 -0.128645552 -0.799613060 1.040008279
[81] -1.106782592 -0.425654152 0.972404483 -0.446671237 1.042690487
[86] -0.620534798 1.303924182 1.147135243 0.867611801 -1.060198771
[91] 0.848756794 1.337845061 0.258931385 0.058960500 -1.521445353
[96] 0.210192665 0.690863151 -0.361998348 0.632873142 0.167392522
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.4616069 -1.77576 1.295714 -0.7070125 0.9200605 1.395083 -0.3021026
[2,] -0.4616069 -1.77576 1.295714 -0.7070125 0.9200605 1.395083 -0.3021026
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.3259224 -0.8014379 1.608641 1.209286 1.186031 0.02855053 -1.169163
[2,] 0.3259224 -0.8014379 1.608641 1.209286 1.186031 0.02855053 -1.169163
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.6166571 -0.3407518 -0.8416845 0.0229068 0.0908241 1.033512 -0.1088809
[2,] 0.6166571 -0.3407518 -0.8416845 0.0229068 0.0908241 1.033512 -0.1088809
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.7573161 -0.03598315 0.9907157 0.9815038 0.5757374 -1.442264 -0.006672274
[2,] 0.7573161 -0.03598315 0.9907157 0.9815038 0.5757374 -1.442264 -0.006672274
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.8400977 -2.124336 1.257155 -1.429447 -0.5335048 1.278925 0.002543604
[2,] -0.8400977 -2.124336 1.257155 -1.429447 -0.5335048 1.278925 0.002543604
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 1.01134 0.02605003 -0.04312799 0.5120413 -0.3017627 0.2525301 -0.4407666
[2,] 1.01134 0.02605003 -0.04312799 0.5120413 -0.3017627 0.2525301 -0.4407666
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.1920822 -2.911752 -0.5086272 0.08994219 1.742819 2.587312 0.7124796
[2,] -0.1920822 -2.911752 -0.5086272 0.08994219 1.742819 2.587312 0.7124796
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.1501067 0.4070419 1.191115 -1.485253 -1.143979 -0.3752135 0.4455384
[2,] -0.1501067 0.4070419 1.191115 -1.485253 -1.143979 -0.3752135 0.4455384
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 1.73797 -1.153229 0.6718239 1.007769 0.1583842 -0.8564801 -0.287661
[2,] 1.73797 -1.153229 0.6718239 1.007769 0.1583842 -0.8564801 -0.287661
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.4182108 -0.06552619 1.209256 -1.155387 -0.8099744 0.6542538 1.337301
[2,] 0.4182108 -0.06552619 1.209256 -1.155387 -0.8099744 0.6542538 1.337301
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.8206421 -0.428664 -0.0580229 0.8460215 -0.8401646 -2.145877 -1.318888
[2,] 0.8206421 -0.428664 -0.0580229 0.8460215 -0.8401646 -2.145877 -1.318888
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.1286456 -0.7996131 1.040008 -1.106783 -0.4256542 0.9724045 -0.4466712
[2,] -0.1286456 -0.7996131 1.040008 -1.106783 -0.4256542 0.9724045 -0.4466712
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 1.04269 -0.6205348 1.303924 1.147135 0.8676118 -1.060199 0.8487568
[2,] 1.04269 -0.6205348 1.303924 1.147135 0.8676118 -1.060199 0.8487568
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 1.337845 0.2589314 0.0589605 -1.521445 0.2101927 0.6908632 -0.3619983
[2,] 1.337845 0.2589314 0.0589605 -1.521445 0.2101927 0.6908632 -0.3619983
[,99] [,100]
[1,] 0.6328731 0.1673925
[2,] 0.6328731 0.1673925
>
>
> Max(tmp2)
[1] 2.287092
> Min(tmp2)
[1] -1.985861
> mean(tmp2)
[1] -0.02590829
> Sum(tmp2)
[1] -2.590829
> Var(tmp2)
[1] 0.856971
>
> rowMeans(tmp2)
[1] 0.04927365 -0.46903812 0.65272163 -0.40043815 0.27635498 -0.58483109
[7] 1.29559658 0.37392717 -1.31838091 0.02342223 -0.19686651 0.03512598
[13] 0.53275379 2.03353585 -0.11864366 0.25408902 -0.05477742 -0.43432074
[19] -0.63549710 -1.10072915 -1.20162232 -0.93712778 -0.29861311 1.58679155
[25] -0.46265410 -0.31835991 -0.51013263 -0.79622647 -0.61304220 0.21395426
[31] -0.21344720 0.74814066 1.82055248 0.44044597 -0.55037208 0.65057188
[37] -0.03092541 -1.84801267 0.89846240 -0.10769940 0.09126449 -1.19288529
[43] -1.61779579 0.93396324 1.17497978 -1.21051400 -0.76705588 -0.03438153
[49] 0.32888559 -1.67497842 0.69020219 -0.03156507 -1.13189684 1.27363217
[55] -1.02241924 1.69406188 1.31853688 -0.68305533 0.61618226 -1.38434417
[61] -0.12566756 1.68155159 0.54729434 -1.23252029 -0.03573628 1.00820889
[67] -0.03467792 1.78296425 1.99083859 -0.09495600 -1.27946351 -1.03498394
[73] -0.70700895 0.18518716 0.16115378 -0.79714410 -1.03416890 0.76230762
[79] 0.04041151 0.43466533 -0.80917369 -0.51305436 0.11204554 0.85584804
[85] -1.55876799 -0.06615176 -0.19880315 0.40795441 0.98048811 -0.80054288
[91] -0.52623777 -1.98586142 -0.17570021 0.82498031 0.13506068 0.02156017
[97] 0.51951374 2.28709180 0.00231218 -0.37642542
> rowSums(tmp2)
[1] 0.04927365 -0.46903812 0.65272163 -0.40043815 0.27635498 -0.58483109
[7] 1.29559658 0.37392717 -1.31838091 0.02342223 -0.19686651 0.03512598
[13] 0.53275379 2.03353585 -0.11864366 0.25408902 -0.05477742 -0.43432074
[19] -0.63549710 -1.10072915 -1.20162232 -0.93712778 -0.29861311 1.58679155
[25] -0.46265410 -0.31835991 -0.51013263 -0.79622647 -0.61304220 0.21395426
[31] -0.21344720 0.74814066 1.82055248 0.44044597 -0.55037208 0.65057188
[37] -0.03092541 -1.84801267 0.89846240 -0.10769940 0.09126449 -1.19288529
[43] -1.61779579 0.93396324 1.17497978 -1.21051400 -0.76705588 -0.03438153
[49] 0.32888559 -1.67497842 0.69020219 -0.03156507 -1.13189684 1.27363217
[55] -1.02241924 1.69406188 1.31853688 -0.68305533 0.61618226 -1.38434417
[61] -0.12566756 1.68155159 0.54729434 -1.23252029 -0.03573628 1.00820889
[67] -0.03467792 1.78296425 1.99083859 -0.09495600 -1.27946351 -1.03498394
[73] -0.70700895 0.18518716 0.16115378 -0.79714410 -1.03416890 0.76230762
[79] 0.04041151 0.43466533 -0.80917369 -0.51305436 0.11204554 0.85584804
[85] -1.55876799 -0.06615176 -0.19880315 0.40795441 0.98048811 -0.80054288
[91] -0.52623777 -1.98586142 -0.17570021 0.82498031 0.13506068 0.02156017
[97] 0.51951374 2.28709180 0.00231218 -0.37642542
> 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.04927365 -0.46903812 0.65272163 -0.40043815 0.27635498 -0.58483109
[7] 1.29559658 0.37392717 -1.31838091 0.02342223 -0.19686651 0.03512598
[13] 0.53275379 2.03353585 -0.11864366 0.25408902 -0.05477742 -0.43432074
[19] -0.63549710 -1.10072915 -1.20162232 -0.93712778 -0.29861311 1.58679155
[25] -0.46265410 -0.31835991 -0.51013263 -0.79622647 -0.61304220 0.21395426
[31] -0.21344720 0.74814066 1.82055248 0.44044597 -0.55037208 0.65057188
[37] -0.03092541 -1.84801267 0.89846240 -0.10769940 0.09126449 -1.19288529
[43] -1.61779579 0.93396324 1.17497978 -1.21051400 -0.76705588 -0.03438153
[49] 0.32888559 -1.67497842 0.69020219 -0.03156507 -1.13189684 1.27363217
[55] -1.02241924 1.69406188 1.31853688 -0.68305533 0.61618226 -1.38434417
[61] -0.12566756 1.68155159 0.54729434 -1.23252029 -0.03573628 1.00820889
[67] -0.03467792 1.78296425 1.99083859 -0.09495600 -1.27946351 -1.03498394
[73] -0.70700895 0.18518716 0.16115378 -0.79714410 -1.03416890 0.76230762
[79] 0.04041151 0.43466533 -0.80917369 -0.51305436 0.11204554 0.85584804
[85] -1.55876799 -0.06615176 -0.19880315 0.40795441 0.98048811 -0.80054288
[91] -0.52623777 -1.98586142 -0.17570021 0.82498031 0.13506068 0.02156017
[97] 0.51951374 2.28709180 0.00231218 -0.37642542
> rowMin(tmp2)
[1] 0.04927365 -0.46903812 0.65272163 -0.40043815 0.27635498 -0.58483109
[7] 1.29559658 0.37392717 -1.31838091 0.02342223 -0.19686651 0.03512598
[13] 0.53275379 2.03353585 -0.11864366 0.25408902 -0.05477742 -0.43432074
[19] -0.63549710 -1.10072915 -1.20162232 -0.93712778 -0.29861311 1.58679155
[25] -0.46265410 -0.31835991 -0.51013263 -0.79622647 -0.61304220 0.21395426
[31] -0.21344720 0.74814066 1.82055248 0.44044597 -0.55037208 0.65057188
[37] -0.03092541 -1.84801267 0.89846240 -0.10769940 0.09126449 -1.19288529
[43] -1.61779579 0.93396324 1.17497978 -1.21051400 -0.76705588 -0.03438153
[49] 0.32888559 -1.67497842 0.69020219 -0.03156507 -1.13189684 1.27363217
[55] -1.02241924 1.69406188 1.31853688 -0.68305533 0.61618226 -1.38434417
[61] -0.12566756 1.68155159 0.54729434 -1.23252029 -0.03573628 1.00820889
[67] -0.03467792 1.78296425 1.99083859 -0.09495600 -1.27946351 -1.03498394
[73] -0.70700895 0.18518716 0.16115378 -0.79714410 -1.03416890 0.76230762
[79] 0.04041151 0.43466533 -0.80917369 -0.51305436 0.11204554 0.85584804
[85] -1.55876799 -0.06615176 -0.19880315 0.40795441 0.98048811 -0.80054288
[91] -0.52623777 -1.98586142 -0.17570021 0.82498031 0.13506068 0.02156017
[97] 0.51951374 2.28709180 0.00231218 -0.37642542
>
> colMeans(tmp2)
[1] -0.02590829
> colSums(tmp2)
[1] -2.590829
> colVars(tmp2)
[1] 0.856971
> colSd(tmp2)
[1] 0.9257273
> colMax(tmp2)
[1] 2.287092
> colMin(tmp2)
[1] -1.985861
> colMedians(tmp2)
[1] -0.0352071
> colRanges(tmp2)
[,1]
[1,] -1.985861
[2,] 2.287092
>
> 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] 0.1892327 6.4780035 2.9694813 5.4535035 -0.1799898 -1.9083419
[7] 5.8674849 0.9325398 1.2792977 0.6649386
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.0182183
[2,] -0.6696052
[3,] -0.2191841
[4,] 0.4910949
[5,] 2.3476977
>
> rowApply(tmp,sum)
[1] -2.7086912 8.3052793 12.5577351 7.7058686 0.5319918 2.4005654
[7] -5.2230209 -0.1003607 3.2369385 -4.9601557
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 2 10 10 6 4 4 1 4 8 3
[2,] 4 7 7 9 9 8 5 5 9 4
[3,] 10 3 4 3 7 5 7 6 10 1
[4,] 3 2 9 10 5 10 6 10 2 2
[5,] 8 9 3 5 3 3 4 9 1 7
[6,] 1 5 2 7 2 1 8 7 3 6
[7,] 9 8 8 2 6 7 10 2 5 8
[8,] 7 4 5 4 1 6 3 3 7 10
[9,] 5 1 1 8 8 9 2 8 6 5
[10,] 6 6 6 1 10 2 9 1 4 9
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -0.6261721 -2.3055122 -3.2788771 -4.0974233 -1.6813929 1.1287730
[7] 1.1337594 -0.7468431 0.1491015 -3.7829036 -1.3658095 -2.9824413
[13] 3.2160743 1.5126653 3.3905697 2.6390579 -2.3810480 -1.5716049
[19] -2.4576177 0.5094895
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.4479147
[2,] -1.4016018
[3,] 0.3579347
[4,] 0.6383565
[5,] 1.2270531
>
> rowApply(tmp,sum)
[1] -8.133784 -3.709785 -2.568377 -1.410877 2.224668
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 2 19 16 2 12
[2,] 14 16 1 4 10
[3,] 11 3 12 5 8
[4,] 9 5 3 1 14
[5,] 13 11 7 9 6
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -1.4479147 -0.25694214 -0.43649148 -0.4823408 -0.3260351 -0.63717355
[2,] 1.2270531 0.46438824 -1.12301321 -0.8123168 -0.2151715 0.02860262
[3,] 0.6383565 -1.24157934 -0.01066822 -0.9318080 -0.5662755 -0.56473415
[4,] -1.4016018 -1.20957706 -1.13629773 -2.5575124 0.1611565 0.75034988
[5,] 0.3579347 -0.06180187 -0.57240647 0.6865547 -0.7350672 1.55172824
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.4402701 -1.13848885 1.1423767 -0.6480742 0.65291850 -2.2014910
[2,] 0.9945512 -0.88338067 -0.2399794 -2.3959908 -0.04568749 0.3481349
[3,] -0.9182587 0.05387115 -0.7234468 0.1882124 -0.93537172 -0.8613367
[4,] 0.5793230 0.57505193 0.9174632 0.3092792 -0.28607889 0.8498074
[5,] 0.9184141 0.64610334 -0.9473123 -1.2363303 -0.75158987 -1.1175560
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 1.129208 -0.3423986 0.1434561 1.17266966 -1.0871992 -1.39331689
[2,] 1.269677 -0.5539315 0.2177189 -0.78868216 -0.5115779 -1.13020870
[3,] 1.008909 0.6593908 0.8981553 1.16655614 -0.4034622 0.58567511
[4,] -1.320412 0.2433950 1.1422137 0.01973245 0.4844084 0.44074531
[5,] 1.128692 1.5062097 0.9890257 1.06878186 -0.8632170 -0.07449977
[,19] [,20]
[1,] -0.1520328 -1.3842436
[2,] -0.3478206 0.7878497
[3,] -0.4570637 -0.1534986
[4,] -0.8886641 0.9163412
[5,] -0.6120366 0.3430408
>
>
> 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.3482662 -0.9153342 -0.06070716 0.6395865 0.01065842 -0.3278661 2.158828
col8 col9 col10 col11 col12 col13 col14
row1 1.486515 -0.2063126 -1.628734 -0.6523017 0.7186403 -0.6315801 -0.8531873
col15 col16 col17 col18 col19 col20
row1 0.2943839 0.3542651 -1.129338 -0.6337822 0.6577578 0.821021
> tmp[,"col10"]
col10
row1 -1.62873404
row2 -0.08758322
row3 -0.01656048
row4 0.75100937
row5 0.58877151
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 0.3482662 -0.9153342 -0.06070716 0.63958655 0.01065842 -0.3278661
row5 -0.6327864 0.4180925 0.96384661 0.06118174 -0.24640589 -1.3251460
col7 col8 col9 col10 col11 col12 col13
row1 2.158828 1.4865147 -0.2063126 -1.6287340 -0.6523017 0.7186403 -0.6315801
row5 -0.663639 0.6182796 -0.7342661 0.5887715 3.3730254 1.5785812 2.0952880
col14 col15 col16 col17 col18 col19
row1 -0.8531873 0.2943839 0.3542651 -1.1293383 -0.6337822 0.65775776
row5 -1.8116294 -0.2868356 -0.1307030 -0.9892739 0.7396245 -0.05625138
col20
row1 0.8210210
row5 -0.8201589
> tmp[,c("col6","col20")]
col6 col20
row1 -0.3278661 0.8210210
row2 0.6564043 -1.1128560
row3 -0.2986697 -0.3357187
row4 0.2659500 -0.4228239
row5 -1.3251460 -0.8201589
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.3278661 0.8210210
row5 -1.3251460 -0.8201589
>
>
>
>
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105)
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.94933 52.34024 50.2722 51.40307 50.10934 104.4402 49.90308 49.32786
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.1639 49.28163 50.02604 48.47212 48.04715 49.35632 49.53409 48.70505
col17 col18 col19 col20
row1 49.64486 50.23149 50.65536 106.1359
> tmp[,"col10"]
col10
row1 49.28163
row2 31.04398
row3 29.45652
row4 29.24698
row5 48.40455
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.94933 52.34024 50.2722 51.40307 50.10934 104.4402 49.90308 49.32786
row5 49.79139 49.64147 51.6456 50.11768 50.35795 105.1053 49.89811 47.91541
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.16390 49.28163 50.02604 48.47212 48.04715 49.35632 49.53409 48.70505
row5 50.33602 48.40455 49.72902 50.60498 48.93989 50.90662 50.55265 52.18897
col17 col18 col19 col20
row1 49.64486 50.23149 50.65536 106.1359
row5 49.63650 48.94869 50.57444 105.1596
> tmp[,c("col6","col20")]
col6 col20
row1 104.44015 106.13594
row2 75.67011 72.98919
row3 73.42256 72.88128
row4 74.49757 75.49959
row5 105.10526 105.15964
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.4402 106.1359
row5 105.1053 105.1596
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.4402 106.1359
row5 105.1053 105.1596
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.8795017
[2,] 0.8967177
[3,] -0.2503977
[4,] -0.6674645
[5,] 1.6267853
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.4847815 -1.2848970
[2,] 0.2515443 1.7070653
[3,] 0.1107869 0.7116639
[4,] 1.2634405 -0.4447356
[5,] 1.2024849 -0.5772731
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 1.12021634 -0.76024777
[2,] -0.03625673 1.51019458
[3,] 0.71467422 0.02902947
[4,] -0.09914434 0.82027943
[5,] -0.06392471 0.93064012
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 1.120216
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 1.12021634
[2,] -0.03625673
>
>
>
> 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 -0.7024859 0.06297741 -0.9504033 -0.9317584 0.7524690 -0.6442674
row1 0.9520697 1.25857357 -0.3245088 -1.1049098 -0.5345294 0.1609168
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row3 0.7697976 -0.5151786 -0.6632676 -0.7281902 -0.3684828 -0.5474495 -1.393430
row1 0.2032584 0.2709079 0.2223718 0.8385347 0.5545381 0.4038380 1.427043
[,14] [,15] [,16] [,17] [,18] [,19]
row3 1.7795820 0.8767025 -0.07325838 0.8510664 -0.6503692 0.83680279
row1 0.7479776 0.5144084 -0.04489145 -1.2799901 1.6596574 0.08134708
[,20]
row3 -0.9427379
row1 -1.7182050
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 1.073686 0.6296095 0.1110488 -0.9124321 -0.889767 -0.6938185 0.03117507
[,8] [,9] [,10]
row2 0.7492224 1.012591 1.298709
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.7909403 -1.592386 1.10745 2.226763 -0.1355455 0.5030115 0.6321628
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -1.34462 -1.097273 -1.666668 -1.478785 0.3202244 1.013167 1.543655
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.9218379 1.442354 -0.03297614 -1.53382 0.3607529 -0.7727772
>
>
> 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: 0x5dead0557db0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1479d85735f2d0"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1479d86470d3d1"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1479d82e0b77a2"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1479d85640dd42"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1479d82543012d"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1479d869edc832"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1479d818f45121"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1479d841a3373c"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1479d83df7fce7"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1479d82d999fa1"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1479d8ef79c4e"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1479d87bcf0135"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1479d812b06aa4"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1479d82e92bebc"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1479d87dd63ebd"
>
>
> ### 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: 0x5dead0cd11e0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5dead0cd11e0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5dead0cd11e0>
> rowMedians(tmp)
[1] 0.156394639 0.401343913 -0.215966279 -0.225700813 0.239552705
[6] 0.250322117 0.407571696 -0.319157759 0.269624540 -0.473555944
[11] 0.173226344 0.171256967 0.951486848 -0.137577167 0.071190314
[16] 0.257917978 0.084514677 0.562464037 0.592888556 -0.011239544
[21] -0.095403091 0.168176257 0.395124869 0.729001628 -0.291932150
[26] -0.340375006 -0.206117343 0.115939826 -0.444814590 -0.073565959
[31] 0.534856040 -0.397829676 0.213500819 0.342460929 0.768762898
[36] -0.154639806 -0.299409113 -0.393516910 -0.433208722 -0.578237046
[41] -0.189017068 0.884128911 0.025788564 0.150077711 0.326465270
[46] 0.412993653 -0.094594350 -0.267665682 -0.498046516 0.172307127
[51] 0.460101061 -0.121359120 -0.157769790 -0.182480532 0.092861995
[56] 0.523758932 0.239491111 0.223397669 -0.092220740 0.327329897
[61] 0.118489555 -0.110612970 -0.073383091 -0.150729511 -0.116179745
[66] -0.219832946 -0.204390549 0.810647190 0.345188483 0.145793056
[71] 0.772692515 0.110408865 0.338248313 0.087323123 -0.112229661
[76] -0.368343764 0.023093269 0.582450033 0.366597191 -0.864631499
[81] -0.283995959 0.065408832 0.402400922 0.172008873 -0.648102981
[86] -0.211629552 -0.395288080 0.619589584 0.157938427 -0.383514834
[91] 0.049310861 0.291077677 -0.643268599 0.278985922 -0.066183342
[96] 0.633654966 0.052103541 0.625250142 -0.347193674 -0.264167265
[101] 0.342283636 0.121850214 0.340002710 0.251157721 -0.277662304
[106] 0.208023346 -0.045733761 -0.159373657 -0.117098519 -0.142417605
[111] 0.077219613 0.125959370 -0.405926666 0.215713422 0.507272842
[116] -0.606178279 0.048476600 -0.352557425 0.475739277 -0.277201869
[121] -0.028915356 -0.204287885 -0.490142946 -0.382660073 -0.204669783
[126] -0.059028168 0.358822146 -0.094694311 0.053211047 0.249977648
[131] 0.119767288 0.156637466 0.541799906 -0.268864244 0.335471413
[136] -0.138222385 -0.064807223 0.341483881 0.284277973 -0.058192512
[141] -0.335198174 -0.686864319 -0.284563172 -0.124657279 -0.123599551
[146] 0.002628816 0.428104296 -0.353777141 0.138055828 -0.033167557
[151] -0.159827250 0.379636418 0.513853349 -0.421835332 -0.254669834
[156] 0.517624194 -0.040950614 0.276374347 0.170225022 0.042194339
[161] 0.278820435 0.092122438 0.322892046 -0.331729334 -0.080187676
[166] 0.218986142 -0.208526163 0.271627864 0.242547709 0.245466379
[171] -0.313663818 0.305488725 0.116286843 -0.124246412 -0.130508424
[176] -0.094750857 -0.303337270 -0.179211733 -0.693374695 0.192698199
[181] 0.543680192 0.382834295 0.119676981 0.052170836 -0.262703252
[186] 0.132204997 -0.032352701 -0.370508981 0.353017547 0.050700337
[191] 0.091878922 -0.178488902 -0.002747058 -0.409250803 -0.263396040
[196] -0.312286259 0.022045511 0.613342437 -0.490853344 0.122782078
[201] -0.074492236 0.381965964 -0.471653263 -0.126331620 -0.078908387
[206] 0.264810185 -0.278088149 -0.340960464 -0.208251635 -0.734478781
[211] 0.204120183 0.562291692 -0.370996275 -0.133474697 0.070570771
[216] 0.017206205 -0.366675728 -0.366099605 -0.004882431 -0.102731139
[221] -0.002004222 0.004602255 0.023616988 -0.553499468 0.250482649
[226] 0.021585998 -0.089555836 0.312356871 -0.364266544 -0.066091465
>
> proc.time()
user system elapsed
1.336 1.492 2.819
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: 0x5f6b89eddc10>
> .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: 0x5f6b89eddc10>
> .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: 0x5f6b89eddc10>
> .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: 0x5f6b89eddc10>
> 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: 0x5f6b8aba02d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f6b8aba02d0>
> .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: 0x5f6b8aba02d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f6b8aba02d0>
> .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: 0x5f6b8aba02d0>
> 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: 0x5f6b8b275d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f6b8b275d70>
> .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: 0x5f6b8b275d70>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5f6b8b275d70>
> .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: 0x5f6b8b275d70>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5f6b8b275d70>
> .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: 0x5f6b8b275d70>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5f6b8b275d70>
> .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: 0x5f6b8b275d70>
> 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: 0x5f6b8ade9370>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5f6b8ade9370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f6b8ade9370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f6b8ade9370>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile147c7b10b63d2e" "BufferedMatrixFile147c7b62c1f604"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile147c7b10b63d2e" "BufferedMatrixFile147c7b62c1f604"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f6b8ad34ff0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f6b8ad34ff0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5f6b8ad34ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5f6b8ad34ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5f6b8ad34ff0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5f6b8ad34ff0>
> .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: 0x5f6b8af173d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5f6b8af173d0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5f6b8af173d0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5f6b8af173d0>
> 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: 0x5f6b8c6c8fb0>
> .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: 0x5f6b8c6c8fb0>
> rm(P)
>
> proc.time()
user system elapsed
0.244 0.047 0.280
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.252 0.036 0.276