| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-03-04 11:34 -0500 (Wed, 04 Mar 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" | 4882 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences" | 4574 |
| 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/2357 | 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 | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | 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-03-03 22:00:15 -0500 (Tue, 03 Mar 2026) |
| EndedAt: 2026-03-03 22:00:40 -0500 (Tue, 03 Mar 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.048 0.290
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] "Tue Mar 3 22:00:30 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Tue Mar 3 22:00:30 2026"
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
>
>
> RowMode(tmp2)
<pointer: 0x63820076fc10>
>
>
>
> 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] "Tue Mar 3 22:00:31 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Tue Mar 3 22:00:31 2026"
>
> ColMode(tmp2)
<pointer: 0x63820076fc10>
>
>
>
> ### 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.07159901 0.3522411 -1.6661885 -0.1595284
[2,] -2.32531041 -1.0139288 2.1435049 0.7325984
[3,] -0.05162117 -0.6075395 -0.3642541 -0.4326377
[4,] -2.53871967 -0.4528797 0.5420714 0.5694564
> 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.07159901 0.3522411 1.6661885 0.1595284
[2,] 2.32531041 1.0139288 2.1435049 0.7325984
[3,] 0.05162117 0.6075395 0.3642541 0.4326377
[4,] 2.53871967 0.4528797 0.5420714 0.5694564
> 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.9534717 0.5934990 1.2908092 0.3994101
[2,] 1.5248969 1.0069403 1.4640713 0.8559197
[3,] 0.2272029 0.7794482 0.6035347 0.6577520
[4,] 1.5933360 0.6729634 0.7362550 0.7546233
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 223.60632 31.28723 39.57428 29.15363
[2,] 42.57428 36.08333 41.78422 34.29179
[3,] 27.32365 33.40202 31.39960 32.01016
[4,] 43.47208 32.18251 32.90462 33.11569
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6382015c6ff0>
> exp(tmp5)
<pointer: 0x6382015c6ff0>
> log(tmp5,2)
<pointer: 0x6382015c6ff0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 465.4073
> Min(tmp5)
[1] 54.55815
> mean(tmp5)
[1] 72.98999
> Sum(tmp5)
[1] 14598
> Var(tmp5)
[1] 848.3442
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.27335 69.05022 70.84584 70.32385 69.68303 75.46410 68.53631 71.14361
[9] 71.39888 72.18073
> rowSums(tmp5)
[1] 1825.467 1381.004 1416.917 1406.477 1393.661 1509.282 1370.726 1422.872
[9] 1427.978 1443.615
> rowVars(tmp5)
[1] 7839.58637 89.07413 64.22022 59.31328 49.36941 66.47929
[7] 101.88643 47.43131 91.78781 49.82874
> rowSd(tmp5)
[1] 88.541439 9.437909 8.013752 7.701511 7.026337 8.153483 10.093881
[8] 6.887040 9.580595 7.058948
> rowMax(tmp5)
[1] 465.40725 88.61278 85.88345 90.48144 79.53310 89.31292 94.21715
[8] 82.29922 86.58064 85.96156
> rowMin(tmp5)
[1] 56.48107 56.16624 54.55815 60.32404 56.49564 63.45211 56.66098 56.07207
[9] 55.23788 60.79393
>
> colMeans(tmp5)
[1] 113.11264 65.02942 69.27740 69.94086 77.39927 70.50645 69.08308
[8] 72.03254 75.26545 68.23829 74.77030 72.62874 67.15245 72.98769
[15] 70.95105 72.57600 68.33105 73.26205 67.75511 69.49999
> colSums(tmp5)
[1] 1131.1264 650.2942 692.7740 699.4086 773.9927 705.0645 690.8308
[8] 720.3254 752.6545 682.3829 747.7030 726.2874 671.5245 729.8769
[15] 709.5105 725.7600 683.3105 732.6205 677.5511 694.9999
> colVars(tmp5)
[1] 15435.72909 26.40753 117.53364 34.13603 25.73119 51.27095
[7] 11.95715 16.19173 115.47253 89.95239 128.59239 74.65257
[13] 53.40848 53.17612 91.63533 87.01690 106.92603 73.60374
[19] 53.45189 34.43842
> colSd(tmp5)
[1] 124.240610 5.138826 10.841293 5.842605 5.072592 7.160374
[7] 3.457911 4.023895 10.745815 9.484324 11.339858 8.640172
[13] 7.308111 7.292196 9.572634 9.328285 10.340504 8.579262
[19] 7.311080 5.868426
> colMax(tmp5)
[1] 465.40725 75.10273 86.96838 81.44136 84.50137 82.77206 74.80523
[8] 79.06203 87.37303 85.96156 94.21715 86.58064 78.17555 84.59559
[15] 83.75763 89.31292 87.80561 84.30223 79.14591 79.53310
> colMin(tmp5)
[1] 56.87060 58.67619 55.23788 60.67946 71.26536 60.50138 63.97438 67.29446
[9] 56.49564 56.66098 58.14693 59.56360 56.48107 59.76446 57.60790 59.92635
[17] 54.55815 60.79393 59.11631 61.54638
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 91.27335 NA 70.84584 70.32385 69.68303 75.46410 68.53631 71.14361
[9] 71.39888 72.18073
> rowSums(tmp5)
[1] 1825.467 NA 1416.917 1406.477 1393.661 1509.282 1370.726 1422.872
[9] 1427.978 1443.615
> rowVars(tmp5)
[1] 7839.58637 71.64292 64.22022 59.31328 49.36941 66.47929
[7] 101.88643 47.43131 91.78781 49.82874
> rowSd(tmp5)
[1] 88.541439 8.464214 8.013752 7.701511 7.026337 8.153483 10.093881
[8] 6.887040 9.580595 7.058948
> rowMax(tmp5)
[1] 465.40725 NA 85.88345 90.48144 79.53310 89.31292 94.21715
[8] 82.29922 86.58064 85.96156
> rowMin(tmp5)
[1] 56.48107 NA 54.55815 60.32404 56.49564 63.45211 56.66098 56.07207
[9] 55.23788 60.79393
>
> colMeans(tmp5)
[1] NA 65.02942 69.27740 69.94086 77.39927 70.50645 69.08308 72.03254
[9] 75.26545 68.23829 74.77030 72.62874 67.15245 72.98769 70.95105 72.57600
[17] 68.33105 73.26205 67.75511 69.49999
> colSums(tmp5)
[1] NA 650.2942 692.7740 699.4086 773.9927 705.0645 690.8308 720.3254
[9] 752.6545 682.3829 747.7030 726.2874 671.5245 729.8769 709.5105 725.7600
[17] 683.3105 732.6205 677.5511 694.9999
> colVars(tmp5)
[1] NA 26.40753 117.53364 34.13603 25.73119 51.27095 11.95715
[8] 16.19173 115.47253 89.95239 128.59239 74.65257 53.40848 53.17612
[15] 91.63533 87.01690 106.92603 73.60374 53.45189 34.43842
> colSd(tmp5)
[1] NA 5.138826 10.841293 5.842605 5.072592 7.160374 3.457911
[8] 4.023895 10.745815 9.484324 11.339858 8.640172 7.308111 7.292196
[15] 9.572634 9.328285 10.340504 8.579262 7.311080 5.868426
> colMax(tmp5)
[1] NA 75.10273 86.96838 81.44136 84.50137 82.77206 74.80523 79.06203
[9] 87.37303 85.96156 94.21715 86.58064 78.17555 84.59559 83.75763 89.31292
[17] 87.80561 84.30223 79.14591 79.53310
> colMin(tmp5)
[1] NA 58.67619 55.23788 60.67946 71.26536 60.50138 63.97438 67.29446
[9] 56.49564 56.66098 58.14693 59.56360 56.48107 59.76446 57.60790 59.92635
[17] 54.55815 60.79393 59.11631 61.54638
>
> Max(tmp5,na.rm=TRUE)
[1] 465.4073
> Min(tmp5,na.rm=TRUE)
[1] 54.55815
> mean(tmp5,na.rm=TRUE)
[1] 72.91149
> Sum(tmp5,na.rm=TRUE)
[1] 14509.39
> Var(tmp5,na.rm=TRUE)
[1] 851.3899
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.27335 68.02061 70.84584 70.32385 69.68303 75.46410 68.53631 71.14361
[9] 71.39888 72.18073
> rowSums(tmp5,na.rm=TRUE)
[1] 1825.467 1292.392 1416.917 1406.477 1393.661 1509.282 1370.726 1422.872
[9] 1427.978 1443.615
> rowVars(tmp5,na.rm=TRUE)
[1] 7839.58637 71.64292 64.22022 59.31328 49.36941 66.47929
[7] 101.88643 47.43131 91.78781 49.82874
> rowSd(tmp5,na.rm=TRUE)
[1] 88.541439 8.464214 8.013752 7.701511 7.026337 8.153483 10.093881
[8] 6.887040 9.580595 7.058948
> rowMax(tmp5,na.rm=TRUE)
[1] 465.40725 86.96838 85.88345 90.48144 79.53310 89.31292 94.21715
[8] 82.29922 86.58064 85.96156
> rowMin(tmp5,na.rm=TRUE)
[1] 56.48107 56.16624 54.55815 60.32404 56.49564 63.45211 56.66098 56.07207
[9] 55.23788 60.79393
>
> colMeans(tmp5,na.rm=TRUE)
[1] 115.83485 65.02942 69.27740 69.94086 77.39927 70.50645 69.08308
[8] 72.03254 75.26545 68.23829 74.77030 72.62874 67.15245 72.98769
[15] 70.95105 72.57600 68.33105 73.26205 67.75511 69.49999
> colSums(tmp5,na.rm=TRUE)
[1] 1042.5136 650.2942 692.7740 699.4086 773.9927 705.0645 690.8308
[8] 720.3254 752.6545 682.3829 747.7030 726.2874 671.5245 729.8769
[15] 709.5105 725.7600 683.3105 732.6205 677.5511 694.9999
> colVars(tmp5,na.rm=TRUE)
[1] 17281.82813 26.40753 117.53364 34.13603 25.73119 51.27095
[7] 11.95715 16.19173 115.47253 89.95239 128.59239 74.65257
[13] 53.40848 53.17612 91.63533 87.01690 106.92603 73.60374
[19] 53.45189 34.43842
> colSd(tmp5,na.rm=TRUE)
[1] 131.460367 5.138826 10.841293 5.842605 5.072592 7.160374
[7] 3.457911 4.023895 10.745815 9.484324 11.339858 8.640172
[13] 7.308111 7.292196 9.572634 9.328285 10.340504 8.579262
[19] 7.311080 5.868426
> colMax(tmp5,na.rm=TRUE)
[1] 465.40725 75.10273 86.96838 81.44136 84.50137 82.77206 74.80523
[8] 79.06203 87.37303 85.96156 94.21715 86.58064 78.17555 84.59559
[15] 83.75763 89.31292 87.80561 84.30223 79.14591 79.53310
> colMin(tmp5,na.rm=TRUE)
[1] 56.87060 58.67619 55.23788 60.67946 71.26536 60.50138 63.97438 67.29446
[9] 56.49564 56.66098 58.14693 59.56360 56.48107 59.76446 57.60790 59.92635
[17] 54.55815 60.79393 59.11631 61.54638
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.27335 NaN 70.84584 70.32385 69.68303 75.46410 68.53631 71.14361
[9] 71.39888 72.18073
> rowSums(tmp5,na.rm=TRUE)
[1] 1825.467 0.000 1416.917 1406.477 1393.661 1509.282 1370.726 1422.872
[9] 1427.978 1443.615
> rowVars(tmp5,na.rm=TRUE)
[1] 7839.58637 NA 64.22022 59.31328 49.36941 66.47929
[7] 101.88643 47.43131 91.78781 49.82874
> rowSd(tmp5,na.rm=TRUE)
[1] 88.541439 NA 8.013752 7.701511 7.026337 8.153483 10.093881
[8] 6.887040 9.580595 7.058948
> rowMax(tmp5,na.rm=TRUE)
[1] 465.40725 NA 85.88345 90.48144 79.53310 89.31292 94.21715
[8] 82.29922 86.58064 85.96156
> rowMin(tmp5,na.rm=TRUE)
[1] 56.48107 NA 54.55815 60.32404 56.49564 63.45211 56.66098 56.07207
[9] 55.23788 60.79393
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] NaN 63.91017 67.31173 69.78163 78.08082 71.61812 69.09928 72.55899
[9] 74.44442 68.54203 76.61734 73.60912 67.30901 73.92423 69.86962 73.98152
[17] 69.68270 73.82314 68.71152 69.84466
> colSums(tmp5,na.rm=TRUE)
[1] 0.0000 575.1915 605.8056 628.0347 702.7274 644.5631 621.8935 653.0309
[9] 669.9998 616.8783 689.5561 662.4820 605.7811 665.3180 628.8266 665.8337
[17] 627.1443 664.4082 618.4037 628.6019
> colVars(tmp5,na.rm=TRUE)
[1] NA 15.61522 88.75719 38.11782 23.72191 43.77686 13.44884
[8] 15.09773 122.32310 100.15857 106.28638 73.17141 59.80877 49.95572
[15] 89.93303 75.66990 99.73862 79.26246 49.84280 37.40677
> colSd(tmp5,na.rm=TRUE)
[1] NA 3.951610 9.421104 6.173963 4.870514 6.616408 3.667266
[8] 3.885580 11.059977 10.007925 10.309529 8.554029 7.733613 7.067936
[15] 9.483302 8.698845 9.986923 8.902947 7.059943 6.116108
> colMax(tmp5,na.rm=TRUE)
[1] -Inf 69.52193 82.36868 81.44136 84.50137 82.77206 74.80523 79.06203
[9] 87.37303 85.96156 94.21715 86.58064 78.17555 84.59559 83.75763 89.31292
[17] 87.80561 84.30223 79.14591 79.53310
> colMin(tmp5,na.rm=TRUE)
[1] Inf 58.67619 55.23788 60.67946 71.37710 61.27036 63.97438 67.75944
[9] 56.49564 56.66098 60.55736 59.56360 56.48107 59.76446 57.60790 60.32404
[17] 54.55815 60.79393 59.11631 61.54638
>
>
>
>
> 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] 261.4892 139.4785 397.7539 263.6537 138.6256 165.5779 167.4815 211.8146
[9] 159.1488 179.0680
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 261.4892 139.4785 397.7539 263.6537 138.6256 165.5779 167.4815 211.8146
[9] 159.1488 179.0680
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] 4.263256e-14 1.421085e-14 -7.105427e-14 0.000000e+00 0.000000e+00
[6] 2.273737e-13 2.842171e-14 -2.842171e-14 -1.136868e-13 -1.705303e-13
[11] 2.842171e-14 0.000000e+00 -3.552714e-14 -2.842171e-14 0.000000e+00
[16] -5.684342e-14 0.000000e+00 1.136868e-13 8.526513e-14 -3.552714e-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)
+ }
4 11
5 7
9 8
2 13
10 9
4 15
6 8
6 7
3 2
8 19
9 9
10 17
4 17
2 19
3 2
5 18
1 17
2 4
5 16
5 4
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.083599
> Min(tmp)
[1] -2.58701
> mean(tmp)
[1] -0.04399067
> Sum(tmp)
[1] -4.399067
> Var(tmp)
[1] 1.000708
>
> rowMeans(tmp)
[1] -0.04399067
> rowSums(tmp)
[1] -4.399067
> rowVars(tmp)
[1] 1.000708
> rowSd(tmp)
[1] 1.000354
> rowMax(tmp)
[1] 2.083599
> rowMin(tmp)
[1] -2.58701
>
> colMeans(tmp)
[1] -0.67939838 0.03698897 0.20016935 0.04910661 -1.14019530 -1.31856853
[7] 1.10096730 0.44572649 -2.58700999 1.71736871 0.77637684 0.45891064
[13] -0.45998753 -0.61170525 -0.58492262 -0.57176920 -0.12824233 -0.87683498
[19] -0.45676054 -0.77485367 2.08359899 -0.54630072 0.38017318 -1.34808763
[25] 0.33315715 -0.55178546 -0.14258655 1.90085321 0.77109402 -1.02316588
[31] 0.30533794 0.85846278 1.04042094 1.12190591 0.75390689 1.67010790
[37] -1.37246585 0.11652110 0.43475451 1.17102259 -1.09856838 1.49801394
[43] -0.38092846 1.79603086 -0.13888633 0.22191320 -1.77706437 0.41213480
[49] 1.41046195 -0.83107222 -0.65791888 -0.70962024 -0.56273175 -0.45206643
[55] -1.24527372 0.18621323 0.07735652 -0.54251965 -1.32891151 -0.03421447
[61] 0.11839820 0.74988798 -0.39445101 -1.37982511 -2.21825428 -0.86203539
[67] -0.31052873 0.74219992 0.65993440 -0.47627774 -0.31534043 0.78675970
[73] -1.32164486 -0.01767464 -0.51120830 -1.52479152 0.49734663 -0.24070014
[79] -0.03393824 0.11434841 1.76969568 1.32656981 0.48197953 1.07151964
[85] -2.14858987 0.32183524 -0.57318820 0.51639723 -1.99791620 0.37908950
[91] -0.85761368 -1.25331246 -0.63501275 1.68203017 0.24840192 0.54575558
[97] -0.70019258 0.83285777 0.49459114 1.63919135
> colSums(tmp)
[1] -0.67939838 0.03698897 0.20016935 0.04910661 -1.14019530 -1.31856853
[7] 1.10096730 0.44572649 -2.58700999 1.71736871 0.77637684 0.45891064
[13] -0.45998753 -0.61170525 -0.58492262 -0.57176920 -0.12824233 -0.87683498
[19] -0.45676054 -0.77485367 2.08359899 -0.54630072 0.38017318 -1.34808763
[25] 0.33315715 -0.55178546 -0.14258655 1.90085321 0.77109402 -1.02316588
[31] 0.30533794 0.85846278 1.04042094 1.12190591 0.75390689 1.67010790
[37] -1.37246585 0.11652110 0.43475451 1.17102259 -1.09856838 1.49801394
[43] -0.38092846 1.79603086 -0.13888633 0.22191320 -1.77706437 0.41213480
[49] 1.41046195 -0.83107222 -0.65791888 -0.70962024 -0.56273175 -0.45206643
[55] -1.24527372 0.18621323 0.07735652 -0.54251965 -1.32891151 -0.03421447
[61] 0.11839820 0.74988798 -0.39445101 -1.37982511 -2.21825428 -0.86203539
[67] -0.31052873 0.74219992 0.65993440 -0.47627774 -0.31534043 0.78675970
[73] -1.32164486 -0.01767464 -0.51120830 -1.52479152 0.49734663 -0.24070014
[79] -0.03393824 0.11434841 1.76969568 1.32656981 0.48197953 1.07151964
[85] -2.14858987 0.32183524 -0.57318820 0.51639723 -1.99791620 0.37908950
[91] -0.85761368 -1.25331246 -0.63501275 1.68203017 0.24840192 0.54575558
[97] -0.70019258 0.83285777 0.49459114 1.63919135
> 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.67939838 0.03698897 0.20016935 0.04910661 -1.14019530 -1.31856853
[7] 1.10096730 0.44572649 -2.58700999 1.71736871 0.77637684 0.45891064
[13] -0.45998753 -0.61170525 -0.58492262 -0.57176920 -0.12824233 -0.87683498
[19] -0.45676054 -0.77485367 2.08359899 -0.54630072 0.38017318 -1.34808763
[25] 0.33315715 -0.55178546 -0.14258655 1.90085321 0.77109402 -1.02316588
[31] 0.30533794 0.85846278 1.04042094 1.12190591 0.75390689 1.67010790
[37] -1.37246585 0.11652110 0.43475451 1.17102259 -1.09856838 1.49801394
[43] -0.38092846 1.79603086 -0.13888633 0.22191320 -1.77706437 0.41213480
[49] 1.41046195 -0.83107222 -0.65791888 -0.70962024 -0.56273175 -0.45206643
[55] -1.24527372 0.18621323 0.07735652 -0.54251965 -1.32891151 -0.03421447
[61] 0.11839820 0.74988798 -0.39445101 -1.37982511 -2.21825428 -0.86203539
[67] -0.31052873 0.74219992 0.65993440 -0.47627774 -0.31534043 0.78675970
[73] -1.32164486 -0.01767464 -0.51120830 -1.52479152 0.49734663 -0.24070014
[79] -0.03393824 0.11434841 1.76969568 1.32656981 0.48197953 1.07151964
[85] -2.14858987 0.32183524 -0.57318820 0.51639723 -1.99791620 0.37908950
[91] -0.85761368 -1.25331246 -0.63501275 1.68203017 0.24840192 0.54575558
[97] -0.70019258 0.83285777 0.49459114 1.63919135
> colMin(tmp)
[1] -0.67939838 0.03698897 0.20016935 0.04910661 -1.14019530 -1.31856853
[7] 1.10096730 0.44572649 -2.58700999 1.71736871 0.77637684 0.45891064
[13] -0.45998753 -0.61170525 -0.58492262 -0.57176920 -0.12824233 -0.87683498
[19] -0.45676054 -0.77485367 2.08359899 -0.54630072 0.38017318 -1.34808763
[25] 0.33315715 -0.55178546 -0.14258655 1.90085321 0.77109402 -1.02316588
[31] 0.30533794 0.85846278 1.04042094 1.12190591 0.75390689 1.67010790
[37] -1.37246585 0.11652110 0.43475451 1.17102259 -1.09856838 1.49801394
[43] -0.38092846 1.79603086 -0.13888633 0.22191320 -1.77706437 0.41213480
[49] 1.41046195 -0.83107222 -0.65791888 -0.70962024 -0.56273175 -0.45206643
[55] -1.24527372 0.18621323 0.07735652 -0.54251965 -1.32891151 -0.03421447
[61] 0.11839820 0.74988798 -0.39445101 -1.37982511 -2.21825428 -0.86203539
[67] -0.31052873 0.74219992 0.65993440 -0.47627774 -0.31534043 0.78675970
[73] -1.32164486 -0.01767464 -0.51120830 -1.52479152 0.49734663 -0.24070014
[79] -0.03393824 0.11434841 1.76969568 1.32656981 0.48197953 1.07151964
[85] -2.14858987 0.32183524 -0.57318820 0.51639723 -1.99791620 0.37908950
[91] -0.85761368 -1.25331246 -0.63501275 1.68203017 0.24840192 0.54575558
[97] -0.70019258 0.83285777 0.49459114 1.63919135
> colMedians(tmp)
[1] -0.67939838 0.03698897 0.20016935 0.04910661 -1.14019530 -1.31856853
[7] 1.10096730 0.44572649 -2.58700999 1.71736871 0.77637684 0.45891064
[13] -0.45998753 -0.61170525 -0.58492262 -0.57176920 -0.12824233 -0.87683498
[19] -0.45676054 -0.77485367 2.08359899 -0.54630072 0.38017318 -1.34808763
[25] 0.33315715 -0.55178546 -0.14258655 1.90085321 0.77109402 -1.02316588
[31] 0.30533794 0.85846278 1.04042094 1.12190591 0.75390689 1.67010790
[37] -1.37246585 0.11652110 0.43475451 1.17102259 -1.09856838 1.49801394
[43] -0.38092846 1.79603086 -0.13888633 0.22191320 -1.77706437 0.41213480
[49] 1.41046195 -0.83107222 -0.65791888 -0.70962024 -0.56273175 -0.45206643
[55] -1.24527372 0.18621323 0.07735652 -0.54251965 -1.32891151 -0.03421447
[61] 0.11839820 0.74988798 -0.39445101 -1.37982511 -2.21825428 -0.86203539
[67] -0.31052873 0.74219992 0.65993440 -0.47627774 -0.31534043 0.78675970
[73] -1.32164486 -0.01767464 -0.51120830 -1.52479152 0.49734663 -0.24070014
[79] -0.03393824 0.11434841 1.76969568 1.32656981 0.48197953 1.07151964
[85] -2.14858987 0.32183524 -0.57318820 0.51639723 -1.99791620 0.37908950
[91] -0.85761368 -1.25331246 -0.63501275 1.68203017 0.24840192 0.54575558
[97] -0.70019258 0.83285777 0.49459114 1.63919135
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.6793984 0.03698897 0.2001694 0.04910661 -1.140195 -1.318569 1.100967
[2,] -0.6793984 0.03698897 0.2001694 0.04910661 -1.140195 -1.318569 1.100967
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.4457265 -2.58701 1.717369 0.7763768 0.4589106 -0.4599875 -0.6117053
[2,] 0.4457265 -2.58701 1.717369 0.7763768 0.4589106 -0.4599875 -0.6117053
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.5849226 -0.5717692 -0.1282423 -0.876835 -0.4567605 -0.7748537 2.083599
[2,] -0.5849226 -0.5717692 -0.1282423 -0.876835 -0.4567605 -0.7748537 2.083599
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.5463007 0.3801732 -1.348088 0.3331571 -0.5517855 -0.1425866 1.900853
[2,] -0.5463007 0.3801732 -1.348088 0.3331571 -0.5517855 -0.1425866 1.900853
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.771094 -1.023166 0.3053379 0.8584628 1.040421 1.121906 0.7539069
[2,] 0.771094 -1.023166 0.3053379 0.8584628 1.040421 1.121906 0.7539069
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 1.670108 -1.372466 0.1165211 0.4347545 1.171023 -1.098568 1.498014
[2,] 1.670108 -1.372466 0.1165211 0.4347545 1.171023 -1.098568 1.498014
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.3809285 1.796031 -0.1388863 0.2219132 -1.777064 0.4121348 1.410462
[2,] -0.3809285 1.796031 -0.1388863 0.2219132 -1.777064 0.4121348 1.410462
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.8310722 -0.6579189 -0.7096202 -0.5627317 -0.4520664 -1.245274 0.1862132
[2,] -0.8310722 -0.6579189 -0.7096202 -0.5627317 -0.4520664 -1.245274 0.1862132
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.07735652 -0.5425196 -1.328912 -0.03421447 0.1183982 0.749888 -0.394451
[2,] 0.07735652 -0.5425196 -1.328912 -0.03421447 0.1183982 0.749888 -0.394451
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -1.379825 -2.218254 -0.8620354 -0.3105287 0.7421999 0.6599344 -0.4762777
[2,] -1.379825 -2.218254 -0.8620354 -0.3105287 0.7421999 0.6599344 -0.4762777
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.3153404 0.7867597 -1.321645 -0.01767464 -0.5112083 -1.524792 0.4973466
[2,] -0.3153404 0.7867597 -1.321645 -0.01767464 -0.5112083 -1.524792 0.4973466
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.2407001 -0.03393824 0.1143484 1.769696 1.32657 0.4819795 1.07152
[2,] -0.2407001 -0.03393824 0.1143484 1.769696 1.32657 0.4819795 1.07152
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -2.14859 0.3218352 -0.5731882 0.5163972 -1.997916 0.3790895 -0.8576137
[2,] -2.14859 0.3218352 -0.5731882 0.5163972 -1.997916 0.3790895 -0.8576137
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -1.253312 -0.6350127 1.68203 0.2484019 0.5457556 -0.7001926 0.8328578
[2,] -1.253312 -0.6350127 1.68203 0.2484019 0.5457556 -0.7001926 0.8328578
[,99] [,100]
[1,] 0.4945911 1.639191
[2,] 0.4945911 1.639191
>
>
> Max(tmp2)
[1] 2.439752
> Min(tmp2)
[1] -3.237307
> mean(tmp2)
[1] 0.04238343
> Sum(tmp2)
[1] 4.238343
> Var(tmp2)
[1] 1.114539
>
> rowMeans(tmp2)
[1] 0.776771902 -3.237307093 0.873769900 0.919607228 1.280547177
[6] 0.472317887 0.061671511 -0.296156872 1.133424794 -0.585108181
[11] -1.247334704 1.525116018 -0.006372866 -1.041069889 -0.242522313
[16] -0.136509180 1.607859444 -0.696844832 0.067182795 0.017818060
[21] 0.743654676 -0.531750770 -1.195656670 -1.334992286 1.147785471
[26] 0.138484293 2.439751735 -0.152328490 0.965572497 -1.176212104
[31] 1.762984498 0.042308230 -0.573698067 -0.626259931 -0.121042914
[36] -2.738187204 -1.594241629 0.058836756 1.000836113 -0.930960058
[41] -0.073599276 1.096336556 -2.006792311 -0.498063548 -0.343343620
[46] -0.446761196 -1.038727547 0.754379876 0.069883946 0.638049481
[51] -0.938086655 0.408724280 0.358142135 -0.486049379 2.400271740
[56] -0.760604578 -1.264959141 0.532009477 -1.204018205 1.141515297
[61] -0.656433486 -0.363142854 0.342241551 -0.071576299 -0.170316847
[66] 2.335401169 0.775601760 0.334819742 -0.924124975 -2.142089796
[71] 0.583454688 0.250657706 0.232606393 -1.186595448 -0.941090514
[76] 0.888027811 1.180394735 0.515177832 -0.073310525 -0.124532300
[81] 1.262031981 0.036730443 0.668577913 0.058928944 0.238506801
[86] 2.286749139 0.586381166 -1.625664673 1.583944578 0.816160214
[91] 0.804780213 -0.667909384 -0.525929197 0.574781451 0.159029397
[96] 0.133278863 -0.754841491 -0.142229101 -0.598784932 1.648597888
> rowSums(tmp2)
[1] 0.776771902 -3.237307093 0.873769900 0.919607228 1.280547177
[6] 0.472317887 0.061671511 -0.296156872 1.133424794 -0.585108181
[11] -1.247334704 1.525116018 -0.006372866 -1.041069889 -0.242522313
[16] -0.136509180 1.607859444 -0.696844832 0.067182795 0.017818060
[21] 0.743654676 -0.531750770 -1.195656670 -1.334992286 1.147785471
[26] 0.138484293 2.439751735 -0.152328490 0.965572497 -1.176212104
[31] 1.762984498 0.042308230 -0.573698067 -0.626259931 -0.121042914
[36] -2.738187204 -1.594241629 0.058836756 1.000836113 -0.930960058
[41] -0.073599276 1.096336556 -2.006792311 -0.498063548 -0.343343620
[46] -0.446761196 -1.038727547 0.754379876 0.069883946 0.638049481
[51] -0.938086655 0.408724280 0.358142135 -0.486049379 2.400271740
[56] -0.760604578 -1.264959141 0.532009477 -1.204018205 1.141515297
[61] -0.656433486 -0.363142854 0.342241551 -0.071576299 -0.170316847
[66] 2.335401169 0.775601760 0.334819742 -0.924124975 -2.142089796
[71] 0.583454688 0.250657706 0.232606393 -1.186595448 -0.941090514
[76] 0.888027811 1.180394735 0.515177832 -0.073310525 -0.124532300
[81] 1.262031981 0.036730443 0.668577913 0.058928944 0.238506801
[86] 2.286749139 0.586381166 -1.625664673 1.583944578 0.816160214
[91] 0.804780213 -0.667909384 -0.525929197 0.574781451 0.159029397
[96] 0.133278863 -0.754841491 -0.142229101 -0.598784932 1.648597888
> 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.776771902 -3.237307093 0.873769900 0.919607228 1.280547177
[6] 0.472317887 0.061671511 -0.296156872 1.133424794 -0.585108181
[11] -1.247334704 1.525116018 -0.006372866 -1.041069889 -0.242522313
[16] -0.136509180 1.607859444 -0.696844832 0.067182795 0.017818060
[21] 0.743654676 -0.531750770 -1.195656670 -1.334992286 1.147785471
[26] 0.138484293 2.439751735 -0.152328490 0.965572497 -1.176212104
[31] 1.762984498 0.042308230 -0.573698067 -0.626259931 -0.121042914
[36] -2.738187204 -1.594241629 0.058836756 1.000836113 -0.930960058
[41] -0.073599276 1.096336556 -2.006792311 -0.498063548 -0.343343620
[46] -0.446761196 -1.038727547 0.754379876 0.069883946 0.638049481
[51] -0.938086655 0.408724280 0.358142135 -0.486049379 2.400271740
[56] -0.760604578 -1.264959141 0.532009477 -1.204018205 1.141515297
[61] -0.656433486 -0.363142854 0.342241551 -0.071576299 -0.170316847
[66] 2.335401169 0.775601760 0.334819742 -0.924124975 -2.142089796
[71] 0.583454688 0.250657706 0.232606393 -1.186595448 -0.941090514
[76] 0.888027811 1.180394735 0.515177832 -0.073310525 -0.124532300
[81] 1.262031981 0.036730443 0.668577913 0.058928944 0.238506801
[86] 2.286749139 0.586381166 -1.625664673 1.583944578 0.816160214
[91] 0.804780213 -0.667909384 -0.525929197 0.574781451 0.159029397
[96] 0.133278863 -0.754841491 -0.142229101 -0.598784932 1.648597888
> rowMin(tmp2)
[1] 0.776771902 -3.237307093 0.873769900 0.919607228 1.280547177
[6] 0.472317887 0.061671511 -0.296156872 1.133424794 -0.585108181
[11] -1.247334704 1.525116018 -0.006372866 -1.041069889 -0.242522313
[16] -0.136509180 1.607859444 -0.696844832 0.067182795 0.017818060
[21] 0.743654676 -0.531750770 -1.195656670 -1.334992286 1.147785471
[26] 0.138484293 2.439751735 -0.152328490 0.965572497 -1.176212104
[31] 1.762984498 0.042308230 -0.573698067 -0.626259931 -0.121042914
[36] -2.738187204 -1.594241629 0.058836756 1.000836113 -0.930960058
[41] -0.073599276 1.096336556 -2.006792311 -0.498063548 -0.343343620
[46] -0.446761196 -1.038727547 0.754379876 0.069883946 0.638049481
[51] -0.938086655 0.408724280 0.358142135 -0.486049379 2.400271740
[56] -0.760604578 -1.264959141 0.532009477 -1.204018205 1.141515297
[61] -0.656433486 -0.363142854 0.342241551 -0.071576299 -0.170316847
[66] 2.335401169 0.775601760 0.334819742 -0.924124975 -2.142089796
[71] 0.583454688 0.250657706 0.232606393 -1.186595448 -0.941090514
[76] 0.888027811 1.180394735 0.515177832 -0.073310525 -0.124532300
[81] 1.262031981 0.036730443 0.668577913 0.058928944 0.238506801
[86] 2.286749139 0.586381166 -1.625664673 1.583944578 0.816160214
[91] 0.804780213 -0.667909384 -0.525929197 0.574781451 0.159029397
[96] 0.133278863 -0.754841491 -0.142229101 -0.598784932 1.648597888
>
> colMeans(tmp2)
[1] 0.04238343
> colSums(tmp2)
[1] 4.238343
> colVars(tmp2)
[1] 1.114539
> colSd(tmp2)
[1] 1.055717
> colMax(tmp2)
[1] 2.439752
> colMin(tmp2)
[1] -3.237307
> colMedians(tmp2)
[1] 0.05057249
> colRanges(tmp2)
[,1]
[1,] -3.237307
[2,] 2.439752
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] 1.9422248 -5.7203543 -0.4606723 5.6056916 0.9345533 -1.7162494
[7] 6.3731773 0.2715129 0.8604079 -2.4391227
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.84975711
[2,] -0.57191424
[3,] -0.08711824
[4,] 0.98746770
[5,] 1.90477226
>
> rowApply(tmp,sum)
[1] -2.8824584 2.0905131 -0.3834912 -3.1550931 -5.1029985 2.5358141
[7] 6.4410836 -0.3720902 3.0430689 3.4368207
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 3 7 4 10 5 10 2 6 2 9
[2,] 5 1 1 1 2 9 9 1 1 6
[3,] 1 2 2 6 6 4 7 2 9 8
[4,] 6 8 6 7 1 5 5 10 8 10
[5,] 8 9 8 2 4 7 1 9 7 3
[6,] 2 3 9 5 7 6 3 4 5 5
[7,] 9 10 10 8 10 8 4 8 6 4
[8,] 7 5 3 9 8 3 10 3 3 7
[9,] 10 6 7 3 3 1 6 5 10 2
[10,] 4 4 5 4 9 2 8 7 4 1
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -0.93194083 -0.84203118 -0.73793040 1.03501961 -1.45395146 0.18845543
[7] 2.43511065 0.45105355 -2.39030655 1.33010219 5.39774503 0.22405332
[13] 0.04123903 2.83228607 -0.34721349 2.31533422 -2.64704275 -0.69298566
[19] 2.80155592 4.14611572
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.58476192
[2,] -0.53804316
[3,] -0.47993012
[4,] 0.03171502
[5,] 0.63907934
>
> rowApply(tmp,sum)
[1] 1.535132 -2.332544 1.031903 6.068933 6.851244
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 11 7 8 3 14
[2,] 5 13 2 10 15
[3,] 10 19 1 7 2
[4,] 8 17 5 19 7
[5,] 9 2 10 9 17
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.03171502 -0.527100675 -0.03329573 -0.23654839 -0.16068084 1.2189078
[2,] -0.47993012 0.306862825 1.62193003 0.62387299 -1.90892495 -0.1598485
[3,] -0.53804316 -1.290713164 -1.37352660 -1.04828777 -0.10793905 -1.2721561
[4,] -0.58476192 0.003016806 -0.26887668 1.78560955 -0.06449578 -0.1259246
[5,] 0.63907934 0.665903029 -0.68416142 -0.08962678 0.78808916 0.5274769
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.47836646 0.6005836 0.15949266 -0.6734978 0.8505321 -0.6367632
[2,] 0.05289495 -1.0776849 -1.56686290 0.3175780 0.4318717 -0.1726028
[3,] 1.61838617 0.5161676 -0.06647754 0.6038328 0.5898153 -0.2549632
[4,] 1.15845791 0.7658590 -0.37445282 0.4577301 1.5098340 0.5322806
[5,] 0.08373807 -0.3538717 -0.54200595 0.6244591 2.0156920 0.7561019
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.9340418 -0.7084497 -1.08548764 0.2091009 1.4190761 0.1532289
[2,] -1.0724185 2.5890634 0.03965704 0.9085607 -2.1400959 -1.1684823
[3,] 0.1078303 -1.0662565 0.06639681 2.3454841 -0.5853666 0.6821642
[4,] -0.3727670 0.6412531 0.74620497 -0.7626283 -0.3166546 -0.6756848
[5,] 0.4445525 1.3766759 -0.11398466 -0.3851832 -1.0240017 0.3157883
[,19] [,20]
[1,] -0.2819548 0.78059827
[2,] 0.5645726 -0.04255711
[3,] -0.6987518 2.80430739
[4,] 1.9427717 0.07216192
[5,] 1.2749181 0.53160526
>
>
> 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
row1 -0.05097217 -0.3385291 -1.706251 -0.1535833 -0.01936658 -0.5972183
col7 col8 col9 col10 col11 col12 col13
row1 1.566023 -0.5666783 -0.8129839 -1.428384 -1.173623 -0.1501718 -0.3091933
col14 col15 col16 col17 col18 col19 col20
row1 -0.03914114 -0.5159269 -0.9678845 0.8953342 3.023316 0.5836813 0.0362723
> tmp[,"col10"]
col10
row1 -1.42838392
row2 1.23670863
row3 -0.85166572
row4 2.54798888
row5 0.06973772
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -0.05097217 -0.3385291 -1.7062507 -0.1535833 -0.01936658 -0.5972183
row5 -0.67012258 0.4776470 -0.7147279 -0.1247258 0.24293866 -1.6164214
col7 col8 col9 col10 col11 col12
row1 1.5660227 -0.5666783 -0.8129839 -1.42838392 -1.1736225 -0.1501718
row5 -0.2630909 0.2811192 0.2085804 0.06973772 -0.1532137 -0.1430820
col13 col14 col15 col16 col17 col18
row1 -0.3091933 -0.03914114 -0.51592691 -0.9678845 0.8953342 3.02331639
row5 -0.0614104 0.23847662 -0.06343374 0.2399594 0.4768852 -0.02220909
col19 col20
row1 0.5836813 0.0362723
row5 -0.5881807 2.0694764
> tmp[,c("col6","col20")]
col6 col20
row1 -0.5972183 0.0362723
row2 1.0172342 -0.1006680
row3 -0.4318966 -1.0071892
row4 0.4229306 -0.3927762
row5 -1.6164214 2.0694764
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.5972183 0.0362723
row5 -1.6164214 2.0694764
>
>
>
>
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105)
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.47415 51.08 50.49776 51.72985 50.57819 105.2559 50.75867 49.49436
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.86647 49.21853 50.5349 49.41348 50.82513 49.08378 50.47666 50.22755
col17 col18 col19 col20
row1 48.35993 51.04808 50.43611 106.2346
> tmp[,"col10"]
col10
row1 49.21853
row2 29.62486
row3 28.63039
row4 30.51292
row5 49.89733
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.47415 51.08000 50.49776 51.72985 50.57819 105.2559 50.75867 49.49436
row5 49.43044 49.18358 50.39278 51.60979 51.79989 105.0646 50.28469 49.84986
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.86647 49.21853 50.5349 49.41348 50.82513 49.08378 50.47666 50.22755
row5 48.09268 49.89733 51.8284 48.55289 48.50594 50.95547 51.02564 49.63984
col17 col18 col19 col20
row1 48.35993 51.04808 50.43611 106.2346
row5 51.97177 49.45731 48.18120 103.8131
> tmp[,c("col6","col20")]
col6 col20
row1 105.25590 106.23464
row2 76.71452 75.43474
row3 76.16507 73.70734
row4 76.35923 73.95536
row5 105.06459 103.81308
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.2559 106.2346
row5 105.0646 103.8131
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.2559 106.2346
row5 105.0646 103.8131
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.8253959
[2,] 0.3555300
[3,] -0.4130633
[4,] -0.8275150
[5,] -0.2124869
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.6172241 -0.11572701
[2,] 1.8089923 0.05493536
[3,] -0.1362321 -0.65274080
[4,] -1.6787252 -1.26984752
[5,] 1.4692522 -0.59959351
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -1.8262348 -0.004201919
[2,] 0.4544024 0.134431222
[3,] 0.4632225 -2.299535044
[4,] -0.6892726 -0.304716205
[5,] 0.6278790 -1.193396770
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -1.826235
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -1.8262348
[2,] 0.4544024
>
>
>
> 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.44903464 -0.4301217 0.1217498 1.307582 -0.93163471 -0.1206837
row1 0.01829922 0.4877256 1.7033815 -2.211847 0.01667574 -1.2577956
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row3 -0.1634263 -0.2054994 0.85134152 -2.052051 0.7886751 -1.665940 -1.08041518
row1 1.6375147 0.3733342 0.08227241 -1.146344 1.4407448 0.784011 0.06848372
[,14] [,15] [,16] [,17] [,18] [,19]
row3 -0.5452855 1.5458040 0.8160391 0.5590882 0.0004277894 0.960466
row1 0.5226053 -0.9858693 1.6589424 -2.0754130 -0.9297257269 -1.824398
[,20]
row3 0.02477292
row1 1.08535259
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.256057 2.740705 -1.965589 0.8517007 1.282767 0.1253023 -0.1375077
[,8] [,9] [,10]
row2 0.9904325 0.09497367 -2.677177
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
row5 1.024181 -2.34816 1.144928 -1.332134 0.7779912 0.2757458 0.579029 1.111085
[,9] [,10] [,11] [,12] [,13] [,14] [,15]
row5 0.3496974 -1.561632 0.3950084 1.170817 -1.033581 -1.400811 0.6370737
[,16] [,17] [,18] [,19] [,20]
row5 -1.707967 1.087409 0.3001136 0.203449 0.3658022
>
>
> 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: 0x63820098b650>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1344917cb3abc5"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM134491a0c74d6"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1344911f525f35"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1344916b5cc2e7"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1344916945c69"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1344915611c0e8"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1344914e0a38e1"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1344912e7795eb"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1344913988e331"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1344916faa3772"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1344915eacfa14"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM134491655f6666"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1344916e9bb6b2"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM134491372e240"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1344917f02d6ca"
>
>
> ### 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: 0x638201aa2c20>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x638201aa2c20>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x638201aa2c20>
> rowMedians(tmp)
[1] 0.3754788176 -0.3030053634 -0.3516827225 0.0683010712 -0.3268799876
[6] 0.7322437471 0.4269304870 0.1005435872 0.1965817634 0.2764483246
[11] 0.0061240439 -0.1194183596 0.3350307028 -1.0052041081 -0.1956778809
[16] -0.5453202278 -0.2733227066 0.4725339704 -0.3110132222 0.2295661910
[21] 0.3024814668 0.0765857656 0.0533739244 -0.1291451313 -0.2736545429
[26] 0.1924706360 -0.2434693872 0.2327838395 -0.1745655383 -0.2361094939
[31] -0.1496961711 -0.0781612069 0.1069196745 0.3100607029 -0.1965494428
[36] -0.0050420016 -0.0113716413 0.4683338232 -0.9474224614 0.0112729522
[41] -0.3445543087 0.5033951563 0.3703545309 -0.4166489570 0.0167481281
[46] -0.2577738736 0.3009131471 -0.1102968349 -0.3820847611 0.0450783929
[51] -0.3011379357 0.0953449392 -0.2466137215 -0.0673160030 -0.3220755322
[56] 0.2523390440 -0.6619519884 -0.0304136122 -0.2015694894 0.3869980308
[61] -0.1354839536 0.1475558522 -0.1379513412 0.0542245475 0.0928072857
[66] -0.6933049323 0.4888271042 -0.2746843718 -0.0728917626 -0.2618990226
[71] 0.5427822905 -0.0070542295 -0.1120468319 -0.3245573270 -0.5188082310
[76] 0.4727699909 0.0644211923 -0.3056152469 0.2579435607 -0.6988398166
[81] -0.1213124610 -0.0514629501 0.5855826948 0.1202609057 -0.2836660460
[86] 0.2418893054 -0.2266784022 0.1319709471 -0.0160431394 0.3050342831
[91] 0.2614811888 0.1456893099 0.1715172796 -0.2231668243 0.0778975888
[96] 0.0001561202 0.2242141031 0.0781254011 -0.0957697096 0.5466029421
[101] 0.4838888009 0.0806287519 0.4485474220 -0.1185832701 0.6931549280
[106] 0.2826836221 -0.3987462394 0.4013073982 -0.0236116138 -0.0339403807
[111] 0.1006580357 0.3005826797 0.4071605171 -0.0597449193 -0.1785260411
[116] -0.1547042653 -0.3259171944 -0.1688026335 0.1599611517 -0.3006334428
[121] -0.2314386779 -0.2792441488 0.2118941500 -0.5910277970 0.3202675882
[126] 0.1103362736 -0.2489297611 -0.0223055437 0.3350576225 -0.1713607291
[131] -0.7212766676 0.7220968309 0.2824783218 -0.0112555293 -0.5504680777
[136] -0.4811832024 0.4987196856 -0.7048178218 0.5925476505 0.4592679893
[141] -0.2259600753 0.1073762920 -0.0520775227 0.0733583308 -0.0780689628
[146] 0.0141815175 -0.5443721589 -0.4761077592 -0.1314914784 0.6054045806
[151] -0.3754912430 0.4383696007 0.1498510591 0.2535645485 -0.1706703459
[156] -0.2363078517 -0.0510020761 -0.2669659652 0.5491177676 -0.0327387420
[161] 0.4735887429 0.0905271512 -0.2780474650 0.5196184204 0.2241628019
[166] 0.1069580104 0.3216670010 0.5000821261 0.3450417298 0.0263302484
[171] -0.1084169783 0.3418194101 0.5548858230 -0.1630520710 -0.8505407212
[176] 1.0194442222 0.0109776896 0.1582352442 0.0205510854 -0.1977362669
[181] -0.3501728540 -0.2280051033 -0.0751247673 0.0512465108 -0.1036533300
[186] 0.0155070760 0.3118469882 0.0595726032 0.0784053890 -0.1506067892
[191] -0.4259184765 0.0801278743 -0.3760012117 0.1801028696 -0.1949725096
[196] 0.5856235886 0.4194659589 -0.0178369532 -0.4659242451 0.1041376662
[201] 0.2668710877 -0.3165004737 -0.5054964497 -0.0793865006 0.0394066755
[206] 0.5826287073 0.0509394006 -0.1154816104 -0.5912324253 -0.2275566711
[211] -0.1766041357 -0.4563501500 -0.1480452187 0.2597873872 0.1291091506
[216] -0.1432396591 0.1139050597 0.0457380681 0.0141274111 0.3146144229
[221] -0.1704357642 -0.0049142824 0.1398100062 -0.2281364666 -0.3465976033
[226] -0.0994923377 -0.0868681599 -0.1754035801 -0.2102093679 -0.1204681891
>
> proc.time()
user system elapsed
1.392 1.484 2.866
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: 0x62e92f0b9c10>
> .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: 0x62e92f0b9c10>
> .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: 0x62e92f0b9c10>
> .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: 0x62e92f0b9c10>
> 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: 0x62e92fd7c2d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62e92fd7c2d0>
> .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: 0x62e92fd7c2d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62e92fd7c2d0>
> .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: 0x62e92fd7c2d0>
> 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: 0x62e930451d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62e930451d70>
> .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: 0x62e930451d70>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x62e930451d70>
> .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: 0x62e930451d70>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x62e930451d70>
> .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: 0x62e930451d70>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x62e930451d70>
> .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: 0x62e930451d70>
> 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: 0x62e92ffc5370>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x62e92ffc5370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62e92ffc5370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62e92ffc5370>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile13456c1ca0d003" "BufferedMatrixFile13456c7b496e56"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile13456c1ca0d003" "BufferedMatrixFile13456c7b496e56"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x62e92ff10ff0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62e92ff10ff0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x62e92ff10ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x62e92ff10ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x62e92ff10ff0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x62e92ff10ff0>
> .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: 0x62e9300f33d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62e9300f33d0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x62e9300f33d0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x62e9300f33d0>
> 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: 0x62e9318a4fb0>
> .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: 0x62e9318a4fb0>
> rm(P)
>
> proc.time()
user system elapsed
0.270 0.049 0.305
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.242 0.051 0.279