| Back to Build/check report for BioC 3.24: simplified long |
|
This page was generated on 2026-05-14 11:32 -0400 (Thu, 14 May 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.4 LTS) | x86_64 | 4.6.0 RC (2026-04-17 r89917) -- "Because it was There" | 4893 |
| 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 259/2374 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.77.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.4 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.77.0 |
| Command: /home/biocbuild/bbs-3.24-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.24-bioc/R/site-library --timings BufferedMatrix_1.77.0.tar.gz |
| StartedAt: 2026-05-13 21:54:51 -0400 (Wed, 13 May 2026) |
| EndedAt: 2026-05-13 21:55:15 -0400 (Wed, 13 May 2026) |
| EllapsedTime: 24.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.24-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.24-bioc/R/site-library --timings BufferedMatrix_1.77.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.6.0 RC (2026-04-17 r89917)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
* running under: Ubuntu 24.04.4 LTS
* using session charset: UTF-8
* current time: 2026-05-14 01:54:51 UTC
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.77.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.1) 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.24-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.24-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.24-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.77.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.24-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.24-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.24-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.24-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.24-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.24-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.24-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 version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
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.246 0.040 0.274
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
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.24-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 480233 25.7 1053308 56.3 637571 34.1
Vcells 887253 6.8 8388608 64.0 2083896 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] "Wed May 13 21:55:06 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] "Wed May 13 21:55:06 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: 0x59f0cd3c8520>
>
>
>
> 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] "Wed May 13 21:55:07 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] "Wed May 13 21:55:07 2026"
>
> ColMode(tmp2)
<pointer: 0x59f0cd3c8520>
>
>
>
> ### 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.5535670 -1.3796615 -1.0730179 -0.2035012
[2,] 0.5168140 -0.3790412 0.2272367 -0.9519260
[3,] -0.4903510 0.1030871 -0.3269296 0.2762261
[4,] -0.7978417 -1.5401794 2.0877458 -1.1398928
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 99.5535670 1.3796615 1.0730179 0.2035012
[2,] 0.5168140 0.3790412 0.2272367 0.9519260
[3,] 0.4903510 0.1030871 0.3269296 0.2762261
[4,] 0.7978417 1.5401794 2.0877458 1.1398928
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 9.9776534 1.1745899 1.0358658 0.4511111
[2,] 0.7188977 0.6156632 0.4766935 0.9756669
[3,] 0.7002507 0.3210718 0.5717776 0.5255721
[4,] 0.8932199 1.2410397 1.4449034 1.0676576
>
> 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.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 224.33010 38.12556 36.43168 29.71461
[2,] 32.70579 31.53567 29.99417 35.70860
[3,] 32.49286 28.31380 31.04471 30.53195
[4,] 34.73004 38.95058 41.53678 36.81647
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x59f0ce1b38f0>
> exp(tmp5)
<pointer: 0x59f0ce1b38f0>
> log(tmp5,2)
<pointer: 0x59f0ce1b38f0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.9137
> Min(tmp5)
[1] 52.44238
> mean(tmp5)
[1] 71.94532
> Sum(tmp5)
[1] 14389.06
> Var(tmp5)
[1] 865.4174
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.75710 67.79872 66.71584 71.91265 71.18076 71.20734 69.30123 70.95956
[9] 70.44587 68.17411
> rowSums(tmp5)
[1] 1835.142 1355.974 1334.317 1438.253 1423.615 1424.147 1386.025 1419.191
[9] 1408.917 1363.482
> rowVars(tmp5)
[1] 7874.07484 48.01401 56.57777 66.49563 134.61374 83.82058
[7] 94.38992 114.46625 46.06475 58.63061
> rowSd(tmp5)
[1] 88.735984 6.929214 7.521820 8.154485 11.602316 9.155358 9.715448
[8] 10.698890 6.787102 7.657063
> rowMax(tmp5)
[1] 466.91371 80.35105 86.34725 89.76127 97.83492 91.64663 89.91058
[8] 86.92551 82.21257 85.73791
> rowMin(tmp5)
[1] 54.21641 58.14205 57.72132 54.75845 55.66946 55.46880 55.25117 52.44238
[9] 59.11427 54.86887
>
> colMeans(tmp5)
[1] 109.23760 69.47060 69.98236 68.34336 71.46524 65.49519 74.25943
[8] 71.86246 67.00325 71.90043 68.57413 66.30617 69.28504 71.03271
[15] 70.34363 71.19349 68.91981 66.46890 74.28570 73.47684
> colSums(tmp5)
[1] 1092.3760 694.7060 699.8236 683.4336 714.6524 654.9519 742.5943
[8] 718.6246 670.0325 719.0043 685.7413 663.0617 692.8504 710.3271
[15] 703.4363 711.9349 689.1981 664.6890 742.8570 734.7684
> colVars(tmp5)
[1] 15811.08306 72.46852 115.23150 42.37567 102.22394 80.88478
[7] 53.76788 100.96295 24.90322 74.61265 71.95962 31.01441
[13] 66.14726 265.57024 107.66744 68.23107 88.69207 32.67132
[19] 44.54601 117.59100
> colSd(tmp5)
[1] 125.742129 8.512844 10.734594 6.509660 10.110585 8.993597
[7] 7.332659 10.048032 4.990313 8.637862 8.482902 5.569059
[13] 8.133097 16.296326 10.376292 8.260210 9.417647 5.715883
[19] 6.674280 10.843938
> colMax(tmp5)
[1] 466.91371 81.07052 86.45336 78.68202 89.64367 82.09501 85.08553
[8] 84.25196 76.67793 84.77935 80.35105 78.46255 85.01821 97.83492
[15] 89.91058 86.61594 83.90329 72.76662 85.39768 91.64663
> colMin(tmp5)
[1] 65.24464 55.72399 56.63635 60.03635 61.16692 54.75845 60.69054 55.25117
[9] 59.80682 58.80245 55.66946 60.16401 58.14205 54.21641 52.44238 58.03218
[17] 55.46880 58.20788 65.03792 58.87497
>
>
> ### 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.75710 67.79872 66.71584 71.91265 71.18076 NA 69.30123 70.95956
[9] 70.44587 68.17411
> rowSums(tmp5)
[1] 1835.142 1355.974 1334.317 1438.253 1423.615 NA 1386.025 1419.191
[9] 1408.917 1363.482
> rowVars(tmp5)
[1] 7874.07484 48.01401 56.57777 66.49563 134.61374 81.31496
[7] 94.38992 114.46625 46.06475 58.63061
> rowSd(tmp5)
[1] 88.735984 6.929214 7.521820 8.154485 11.602316 9.017481 9.715448
[8] 10.698890 6.787102 7.657063
> rowMax(tmp5)
[1] 466.91371 80.35105 86.34725 89.76127 97.83492 NA 89.91058
[8] 86.92551 82.21257 85.73791
> rowMin(tmp5)
[1] 54.21641 58.14205 57.72132 54.75845 55.66946 NA 55.25117 52.44238
[9] 59.11427 54.86887
>
> colMeans(tmp5)
[1] 109.23760 69.47060 69.98236 68.34336 71.46524 NA 74.25943
[8] 71.86246 67.00325 71.90043 68.57413 66.30617 69.28504 71.03271
[15] 70.34363 71.19349 68.91981 66.46890 74.28570 73.47684
> colSums(tmp5)
[1] 1092.3760 694.7060 699.8236 683.4336 714.6524 NA 742.5943
[8] 718.6246 670.0325 719.0043 685.7413 663.0617 692.8504 710.3271
[15] 703.4363 711.9349 689.1981 664.6890 742.8570 734.7684
> colVars(tmp5)
[1] 15811.08306 72.46852 115.23150 42.37567 102.22394 NA
[7] 53.76788 100.96295 24.90322 74.61265 71.95962 31.01441
[13] 66.14726 265.57024 107.66744 68.23107 88.69207 32.67132
[19] 44.54601 117.59100
> colSd(tmp5)
[1] 125.742129 8.512844 10.734594 6.509660 10.110585 NA
[7] 7.332659 10.048032 4.990313 8.637862 8.482902 5.569059
[13] 8.133097 16.296326 10.376292 8.260210 9.417647 5.715883
[19] 6.674280 10.843938
> colMax(tmp5)
[1] 466.91371 81.07052 86.45336 78.68202 89.64367 NA 85.08553
[8] 84.25196 76.67793 84.77935 80.35105 78.46255 85.01821 97.83492
[15] 89.91058 86.61594 83.90329 72.76662 85.39768 91.64663
> colMin(tmp5)
[1] 65.24464 55.72399 56.63635 60.03635 61.16692 NA 60.69054 55.25117
[9] 59.80682 58.80245 55.66946 60.16401 58.14205 54.21641 52.44238 58.03218
[17] 55.46880 58.20788 65.03792 58.87497
>
> Max(tmp5,na.rm=TRUE)
[1] 466.9137
> Min(tmp5,na.rm=TRUE)
[1] 52.44238
> mean(tmp5,na.rm=TRUE)
[1] 72.00464
> Sum(tmp5,na.rm=TRUE)
[1] 14328.92
> Var(tmp5,na.rm=TRUE)
[1] 869.0808
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.75710 67.79872 66.71584 71.91265 71.18076 71.78981 69.30123 70.95956
[9] 70.44587 68.17411
> rowSums(tmp5,na.rm=TRUE)
[1] 1835.142 1355.974 1334.317 1438.253 1423.615 1364.006 1386.025 1419.191
[9] 1408.917 1363.482
> rowVars(tmp5,na.rm=TRUE)
[1] 7874.07484 48.01401 56.57777 66.49563 134.61374 81.31496
[7] 94.38992 114.46625 46.06475 58.63061
> rowSd(tmp5,na.rm=TRUE)
[1] 88.735984 6.929214 7.521820 8.154485 11.602316 9.017481 9.715448
[8] 10.698890 6.787102 7.657063
> rowMax(tmp5,na.rm=TRUE)
[1] 466.91371 80.35105 86.34725 89.76127 97.83492 91.64663 89.91058
[8] 86.92551 82.21257 85.73791
> rowMin(tmp5,na.rm=TRUE)
[1] 54.21641 58.14205 57.72132 54.75845 55.66946 55.46880 55.25117 52.44238
[9] 59.11427 54.86887
>
> colMeans(tmp5,na.rm=TRUE)
[1] 109.23760 69.47060 69.98236 68.34336 71.46524 66.09016 74.25943
[8] 71.86246 67.00325 71.90043 68.57413 66.30617 69.28504 71.03271
[15] 70.34363 71.19349 68.91981 66.46890 74.28570 73.47684
> colSums(tmp5,na.rm=TRUE)
[1] 1092.3760 694.7060 699.8236 683.4336 714.6524 594.8114 742.5943
[8] 718.6246 670.0325 719.0043 685.7413 663.0617 692.8504 710.3271
[15] 703.4363 711.9349 689.1981 664.6890 742.8570 734.7684
> colVars(tmp5,na.rm=TRUE)
[1] 15811.08306 72.46852 115.23150 42.37567 102.22394 87.01301
[7] 53.76788 100.96295 24.90322 74.61265 71.95962 31.01441
[13] 66.14726 265.57024 107.66744 68.23107 88.69207 32.67132
[19] 44.54601 117.59100
> colSd(tmp5,na.rm=TRUE)
[1] 125.742129 8.512844 10.734594 6.509660 10.110585 9.328077
[7] 7.332659 10.048032 4.990313 8.637862 8.482902 5.569059
[13] 8.133097 16.296326 10.376292 8.260210 9.417647 5.715883
[19] 6.674280 10.843938
> colMax(tmp5,na.rm=TRUE)
[1] 466.91371 81.07052 86.45336 78.68202 89.64367 82.09501 85.08553
[8] 84.25196 76.67793 84.77935 80.35105 78.46255 85.01821 97.83492
[15] 89.91058 86.61594 83.90329 72.76662 85.39768 91.64663
> colMin(tmp5,na.rm=TRUE)
[1] 65.24464 55.72399 56.63635 60.03635 61.16692 54.75845 60.69054 55.25117
[9] 59.80682 58.80245 55.66946 60.16401 58.14205 54.21641 52.44238 58.03218
[17] 55.46880 58.20788 65.03792 58.87497
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.75710 67.79872 66.71584 71.91265 71.18076 NaN 69.30123 70.95956
[9] 70.44587 68.17411
> rowSums(tmp5,na.rm=TRUE)
[1] 1835.142 1355.974 1334.317 1438.253 1423.615 0.000 1386.025 1419.191
[9] 1408.917 1363.482
> rowVars(tmp5,na.rm=TRUE)
[1] 7874.07484 48.01401 56.57777 66.49563 134.61374 NA
[7] 94.38992 114.46625 46.06475 58.63061
> rowSd(tmp5,na.rm=TRUE)
[1] 88.735984 6.929214 7.521820 8.154485 11.602316 NA 9.715448
[8] 10.698890 6.787102 7.657063
> rowMax(tmp5,na.rm=TRUE)
[1] 466.91371 80.35105 86.34725 89.76127 97.83492 NA 89.91058
[8] 86.92551 82.21257 85.73791
> rowMin(tmp5,na.rm=TRUE)
[1] 54.21641 58.14205 57.72132 54.75845 55.66946 NA 55.25117 52.44238
[9] 59.11427 54.86887
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 113.73779 69.98712 70.63536 67.19462 71.59969 NaN 74.89705
[8] 70.67572 65.92828 72.29302 69.63874 64.95546 67.53691 71.91264
[15] 70.42448 70.96243 70.41437 65.96044 74.24405 71.45798
> colSums(tmp5,na.rm=TRUE)
[1] 1023.6401 629.8840 635.7182 604.7516 644.3972 0.0000 674.0734
[8] 636.0814 593.3545 650.6371 626.7487 584.5992 607.8322 647.2137
[15] 633.8203 638.6619 633.7293 593.6440 668.1964 643.1218
> colVars(tmp5,na.rm=TRUE)
[1] 17559.63655 78.52569 124.83841 32.82709 114.79856 NA
[7] 55.91502 97.73921 15.01620 82.20533 68.20382 14.36656
[13] 40.03611 290.05600 121.05234 76.15937 74.64945 33.84672
[19] 50.09474 86.43696
> colSd(tmp5,na.rm=TRUE)
[1] 132.512779 8.861472 11.173111 5.729493 10.714409 NA
[7] 7.477635 9.886314 3.875074 9.066715 8.258560 3.790324
[13] 6.327409 17.031031 11.002379 8.726934 8.639991 5.817794
[19] 7.077764 9.297148
> colMax(tmp5,na.rm=TRUE)
[1] 466.91371 81.07052 86.45336 76.62866 89.64367 -Inf 85.08553
[8] 84.25196 71.13387 84.77935 80.35105 70.36133 76.02479 97.83492
[15] 89.91058 86.61594 83.90329 72.76662 85.39768 84.07458
> colMin(tmp5,na.rm=TRUE)
[1] 65.24464 55.72399 56.63635 60.03635 61.16692 Inf 60.69054 55.25117
[9] 59.80682 58.80245 55.66946 60.16401 58.14205 54.21641 52.44238 58.03218
[17] 58.48502 58.20788 65.03792 58.87497
>
>
>
>
> 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] 204.5435 128.9065 177.3799 186.6208 298.9306 179.4264 195.2784 151.6586
[9] 285.7857 259.2632
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 204.5435 128.9065 177.3799 186.6208 298.9306 179.4264 195.2784 151.6586
[9] 285.7857 259.2632
>
>
>
> 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.136868e-13 5.684342e-14 1.136868e-13 -1.421085e-13
[6] 2.557954e-13 -5.684342e-14 -5.684342e-14 8.526513e-14 -1.136868e-13
[11] 1.136868e-13 8.526513e-14 5.684342e-14 1.421085e-13 -5.684342e-14
[16] 0.000000e+00 0.000000e+00 -1.136868e-13 -5.684342e-14 -2.273737e-13
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
6 17
3 9
2 4
8 14
3 18
2 2
9 17
7 14
7 2
10 15
10 15
3 5
5 14
4 11
7 7
4 6
3 3
2 12
1 7
5 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] 1.974244
> Min(tmp)
[1] -1.876895
> mean(tmp)
[1] 0.2106309
> Sum(tmp)
[1] 21.06309
> Var(tmp)
[1] 0.9411369
>
> rowMeans(tmp)
[1] 0.2106309
> rowSums(tmp)
[1] 21.06309
> rowVars(tmp)
[1] 0.9411369
> rowSd(tmp)
[1] 0.9701221
> rowMax(tmp)
[1] 1.974244
> rowMin(tmp)
[1] -1.876895
>
> colMeans(tmp)
[1] 0.316166876 1.030217147 1.282057133 0.172607156 -0.159907251
[6] 0.395754944 1.669623642 -1.035975241 0.941768215 0.902110225
[11] -1.514976683 -0.697728693 0.991222558 0.091853328 1.589219025
[16] 1.005216346 0.357406702 -0.850272211 -1.115821890 -1.100088078
[21] 1.290374329 -1.681337085 -1.116617361 -1.876894816 -0.113522362
[26] 1.117108803 -1.259221045 1.161458473 -0.084305758 -0.385145582
[31] -1.191521691 0.843582067 0.028172133 0.685413181 0.330768550
[36] -0.661973463 0.600919386 -1.559736627 -0.390798053 0.015386327
[41] -1.523633126 0.311656344 1.297868333 -0.798209226 1.498597955
[46] 1.763587077 1.245983264 1.925188021 -0.010057629 1.212087634
[51] -0.008789364 -0.582238304 -0.579283233 0.849009432 -0.318827831
[56] 0.480854154 0.294136653 0.485726580 0.304614936 0.201823736
[61] 0.597910967 0.549512287 -0.660641531 0.710579329 -0.978506870
[66] 0.456602905 -0.095770146 -1.236041796 -0.006346590 0.688874086
[71] 1.468095568 1.971466952 1.230078923 -0.223754013 -1.087221288
[76] 0.955717621 -0.600465878 0.406756746 -0.882704799 0.799272244
[81] -0.616630805 1.098028458 -1.748526340 1.059593635 0.697339788
[86] -0.957096011 1.509338495 1.551725000 0.337440377 -0.450665238
[91] -0.302754774 1.518490490 -0.543966355 1.974243973 -0.073904208
[96] 0.942783568 0.117165139 1.065680167 1.559999925 0.188734816
> colSums(tmp)
[1] 0.316166876 1.030217147 1.282057133 0.172607156 -0.159907251
[6] 0.395754944 1.669623642 -1.035975241 0.941768215 0.902110225
[11] -1.514976683 -0.697728693 0.991222558 0.091853328 1.589219025
[16] 1.005216346 0.357406702 -0.850272211 -1.115821890 -1.100088078
[21] 1.290374329 -1.681337085 -1.116617361 -1.876894816 -0.113522362
[26] 1.117108803 -1.259221045 1.161458473 -0.084305758 -0.385145582
[31] -1.191521691 0.843582067 0.028172133 0.685413181 0.330768550
[36] -0.661973463 0.600919386 -1.559736627 -0.390798053 0.015386327
[41] -1.523633126 0.311656344 1.297868333 -0.798209226 1.498597955
[46] 1.763587077 1.245983264 1.925188021 -0.010057629 1.212087634
[51] -0.008789364 -0.582238304 -0.579283233 0.849009432 -0.318827831
[56] 0.480854154 0.294136653 0.485726580 0.304614936 0.201823736
[61] 0.597910967 0.549512287 -0.660641531 0.710579329 -0.978506870
[66] 0.456602905 -0.095770146 -1.236041796 -0.006346590 0.688874086
[71] 1.468095568 1.971466952 1.230078923 -0.223754013 -1.087221288
[76] 0.955717621 -0.600465878 0.406756746 -0.882704799 0.799272244
[81] -0.616630805 1.098028458 -1.748526340 1.059593635 0.697339788
[86] -0.957096011 1.509338495 1.551725000 0.337440377 -0.450665238
[91] -0.302754774 1.518490490 -0.543966355 1.974243973 -0.073904208
[96] 0.942783568 0.117165139 1.065680167 1.559999925 0.188734816
> 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.316166876 1.030217147 1.282057133 0.172607156 -0.159907251
[6] 0.395754944 1.669623642 -1.035975241 0.941768215 0.902110225
[11] -1.514976683 -0.697728693 0.991222558 0.091853328 1.589219025
[16] 1.005216346 0.357406702 -0.850272211 -1.115821890 -1.100088078
[21] 1.290374329 -1.681337085 -1.116617361 -1.876894816 -0.113522362
[26] 1.117108803 -1.259221045 1.161458473 -0.084305758 -0.385145582
[31] -1.191521691 0.843582067 0.028172133 0.685413181 0.330768550
[36] -0.661973463 0.600919386 -1.559736627 -0.390798053 0.015386327
[41] -1.523633126 0.311656344 1.297868333 -0.798209226 1.498597955
[46] 1.763587077 1.245983264 1.925188021 -0.010057629 1.212087634
[51] -0.008789364 -0.582238304 -0.579283233 0.849009432 -0.318827831
[56] 0.480854154 0.294136653 0.485726580 0.304614936 0.201823736
[61] 0.597910967 0.549512287 -0.660641531 0.710579329 -0.978506870
[66] 0.456602905 -0.095770146 -1.236041796 -0.006346590 0.688874086
[71] 1.468095568 1.971466952 1.230078923 -0.223754013 -1.087221288
[76] 0.955717621 -0.600465878 0.406756746 -0.882704799 0.799272244
[81] -0.616630805 1.098028458 -1.748526340 1.059593635 0.697339788
[86] -0.957096011 1.509338495 1.551725000 0.337440377 -0.450665238
[91] -0.302754774 1.518490490 -0.543966355 1.974243973 -0.073904208
[96] 0.942783568 0.117165139 1.065680167 1.559999925 0.188734816
> colMin(tmp)
[1] 0.316166876 1.030217147 1.282057133 0.172607156 -0.159907251
[6] 0.395754944 1.669623642 -1.035975241 0.941768215 0.902110225
[11] -1.514976683 -0.697728693 0.991222558 0.091853328 1.589219025
[16] 1.005216346 0.357406702 -0.850272211 -1.115821890 -1.100088078
[21] 1.290374329 -1.681337085 -1.116617361 -1.876894816 -0.113522362
[26] 1.117108803 -1.259221045 1.161458473 -0.084305758 -0.385145582
[31] -1.191521691 0.843582067 0.028172133 0.685413181 0.330768550
[36] -0.661973463 0.600919386 -1.559736627 -0.390798053 0.015386327
[41] -1.523633126 0.311656344 1.297868333 -0.798209226 1.498597955
[46] 1.763587077 1.245983264 1.925188021 -0.010057629 1.212087634
[51] -0.008789364 -0.582238304 -0.579283233 0.849009432 -0.318827831
[56] 0.480854154 0.294136653 0.485726580 0.304614936 0.201823736
[61] 0.597910967 0.549512287 -0.660641531 0.710579329 -0.978506870
[66] 0.456602905 -0.095770146 -1.236041796 -0.006346590 0.688874086
[71] 1.468095568 1.971466952 1.230078923 -0.223754013 -1.087221288
[76] 0.955717621 -0.600465878 0.406756746 -0.882704799 0.799272244
[81] -0.616630805 1.098028458 -1.748526340 1.059593635 0.697339788
[86] -0.957096011 1.509338495 1.551725000 0.337440377 -0.450665238
[91] -0.302754774 1.518490490 -0.543966355 1.974243973 -0.073904208
[96] 0.942783568 0.117165139 1.065680167 1.559999925 0.188734816
> colMedians(tmp)
[1] 0.316166876 1.030217147 1.282057133 0.172607156 -0.159907251
[6] 0.395754944 1.669623642 -1.035975241 0.941768215 0.902110225
[11] -1.514976683 -0.697728693 0.991222558 0.091853328 1.589219025
[16] 1.005216346 0.357406702 -0.850272211 -1.115821890 -1.100088078
[21] 1.290374329 -1.681337085 -1.116617361 -1.876894816 -0.113522362
[26] 1.117108803 -1.259221045 1.161458473 -0.084305758 -0.385145582
[31] -1.191521691 0.843582067 0.028172133 0.685413181 0.330768550
[36] -0.661973463 0.600919386 -1.559736627 -0.390798053 0.015386327
[41] -1.523633126 0.311656344 1.297868333 -0.798209226 1.498597955
[46] 1.763587077 1.245983264 1.925188021 -0.010057629 1.212087634
[51] -0.008789364 -0.582238304 -0.579283233 0.849009432 -0.318827831
[56] 0.480854154 0.294136653 0.485726580 0.304614936 0.201823736
[61] 0.597910967 0.549512287 -0.660641531 0.710579329 -0.978506870
[66] 0.456602905 -0.095770146 -1.236041796 -0.006346590 0.688874086
[71] 1.468095568 1.971466952 1.230078923 -0.223754013 -1.087221288
[76] 0.955717621 -0.600465878 0.406756746 -0.882704799 0.799272244
[81] -0.616630805 1.098028458 -1.748526340 1.059593635 0.697339788
[86] -0.957096011 1.509338495 1.551725000 0.337440377 -0.450665238
[91] -0.302754774 1.518490490 -0.543966355 1.974243973 -0.073904208
[96] 0.942783568 0.117165139 1.065680167 1.559999925 0.188734816
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.3161669 1.030217 1.282057 0.1726072 -0.1599073 0.3957549 1.669624
[2,] 0.3161669 1.030217 1.282057 0.1726072 -0.1599073 0.3957549 1.669624
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -1.035975 0.9417682 0.9021102 -1.514977 -0.6977287 0.9912226 0.09185333
[2,] -1.035975 0.9417682 0.9021102 -1.514977 -0.6977287 0.9912226 0.09185333
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 1.589219 1.005216 0.3574067 -0.8502722 -1.115822 -1.100088 1.290374
[2,] 1.589219 1.005216 0.3574067 -0.8502722 -1.115822 -1.100088 1.290374
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -1.681337 -1.116617 -1.876895 -0.1135224 1.117109 -1.259221 1.161458
[2,] -1.681337 -1.116617 -1.876895 -0.1135224 1.117109 -1.259221 1.161458
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.08430576 -0.3851456 -1.191522 0.8435821 0.02817213 0.6854132 0.3307685
[2,] -0.08430576 -0.3851456 -1.191522 0.8435821 0.02817213 0.6854132 0.3307685
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.6619735 0.6009194 -1.559737 -0.3907981 0.01538633 -1.523633 0.3116563
[2,] -0.6619735 0.6009194 -1.559737 -0.3907981 0.01538633 -1.523633 0.3116563
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 1.297868 -0.7982092 1.498598 1.763587 1.245983 1.925188 -0.01005763
[2,] 1.297868 -0.7982092 1.498598 1.763587 1.245983 1.925188 -0.01005763
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 1.212088 -0.008789364 -0.5822383 -0.5792832 0.8490094 -0.3188278 0.4808542
[2,] 1.212088 -0.008789364 -0.5822383 -0.5792832 0.8490094 -0.3188278 0.4808542
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.2941367 0.4857266 0.3046149 0.2018237 0.597911 0.5495123 -0.6606415
[2,] 0.2941367 0.4857266 0.3046149 0.2018237 0.597911 0.5495123 -0.6606415
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.7105793 -0.9785069 0.4566029 -0.09577015 -1.236042 -0.00634659 0.6888741
[2,] 0.7105793 -0.9785069 0.4566029 -0.09577015 -1.236042 -0.00634659 0.6888741
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 1.468096 1.971467 1.230079 -0.223754 -1.087221 0.9557176 -0.6004659
[2,] 1.468096 1.971467 1.230079 -0.223754 -1.087221 0.9557176 -0.6004659
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.4067567 -0.8827048 0.7992722 -0.6166308 1.098028 -1.748526 1.059594
[2,] 0.4067567 -0.8827048 0.7992722 -0.6166308 1.098028 -1.748526 1.059594
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 0.6973398 -0.957096 1.509338 1.551725 0.3374404 -0.4506652 -0.3027548
[2,] 0.6973398 -0.957096 1.509338 1.551725 0.3374404 -0.4506652 -0.3027548
[,92] [,93] [,94] [,95] [,96] [,97] [,98] [,99]
[1,] 1.51849 -0.5439664 1.974244 -0.07390421 0.9427836 0.1171651 1.06568 1.56
[2,] 1.51849 -0.5439664 1.974244 -0.07390421 0.9427836 0.1171651 1.06568 1.56
[,100]
[1,] 0.1887348
[2,] 0.1887348
>
>
> Max(tmp2)
[1] 2.43595
> Min(tmp2)
[1] -2.413861
> mean(tmp2)
[1] 0.01776342
> Sum(tmp2)
[1] 1.776342
> Var(tmp2)
[1] 0.8938425
>
> rowMeans(tmp2)
[1] -0.690029431 0.189067637 0.721262269 0.904323328 0.084229172
[6] -0.558225426 1.144153295 0.580063519 0.366488596 -0.100491290
[11] 0.208214481 0.177006435 1.474052169 0.188415878 0.404949192
[16] -0.967709979 0.143167683 -0.798238354 -0.865693635 2.140791650
[21] 0.485892240 0.190472153 0.609979874 -0.472992320 0.510850615
[26] -2.413861429 0.088786128 -1.602594468 1.573705431 0.874311934
[31] 0.503895313 -0.481074784 0.271932926 -1.383304202 -0.478284001
[36] 0.888613782 -0.528598069 -0.950128624 0.758069882 0.377443209
[41] -0.045982378 -1.178440595 -1.009526318 -0.020445748 0.170173834
[46] -0.713842700 1.579968143 0.697667956 0.796690225 -0.301557624
[51] 0.282583508 -1.454658603 1.091542640 -0.508022364 -0.187136187
[56] -0.425919723 -0.007007309 -0.189404855 -0.590071066 0.580763070
[61] -0.563049473 -2.277691246 -0.039181892 -0.179959874 2.435949982
[66] 0.955433993 0.207109611 1.008819822 0.316757266 -1.260355835
[71] -0.235400921 -0.587820124 1.625232715 0.175487316 -0.281109778
[76] 1.870102026 1.888223749 0.019825371 0.472562215 0.081624461
[81] -1.127985278 0.653982099 -0.071492698 0.026288296 1.588343501
[86] 0.520476241 -0.162274711 0.729230697 -0.077682630 -1.640879017
[91] -0.538993387 0.817357899 -0.834599524 -1.126630235 0.466627237
[96] -1.227300385 -2.153114095 0.543491997 -1.336001381 -1.041348340
> rowSums(tmp2)
[1] -0.690029431 0.189067637 0.721262269 0.904323328 0.084229172
[6] -0.558225426 1.144153295 0.580063519 0.366488596 -0.100491290
[11] 0.208214481 0.177006435 1.474052169 0.188415878 0.404949192
[16] -0.967709979 0.143167683 -0.798238354 -0.865693635 2.140791650
[21] 0.485892240 0.190472153 0.609979874 -0.472992320 0.510850615
[26] -2.413861429 0.088786128 -1.602594468 1.573705431 0.874311934
[31] 0.503895313 -0.481074784 0.271932926 -1.383304202 -0.478284001
[36] 0.888613782 -0.528598069 -0.950128624 0.758069882 0.377443209
[41] -0.045982378 -1.178440595 -1.009526318 -0.020445748 0.170173834
[46] -0.713842700 1.579968143 0.697667956 0.796690225 -0.301557624
[51] 0.282583508 -1.454658603 1.091542640 -0.508022364 -0.187136187
[56] -0.425919723 -0.007007309 -0.189404855 -0.590071066 0.580763070
[61] -0.563049473 -2.277691246 -0.039181892 -0.179959874 2.435949982
[66] 0.955433993 0.207109611 1.008819822 0.316757266 -1.260355835
[71] -0.235400921 -0.587820124 1.625232715 0.175487316 -0.281109778
[76] 1.870102026 1.888223749 0.019825371 0.472562215 0.081624461
[81] -1.127985278 0.653982099 -0.071492698 0.026288296 1.588343501
[86] 0.520476241 -0.162274711 0.729230697 -0.077682630 -1.640879017
[91] -0.538993387 0.817357899 -0.834599524 -1.126630235 0.466627237
[96] -1.227300385 -2.153114095 0.543491997 -1.336001381 -1.041348340
> 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.690029431 0.189067637 0.721262269 0.904323328 0.084229172
[6] -0.558225426 1.144153295 0.580063519 0.366488596 -0.100491290
[11] 0.208214481 0.177006435 1.474052169 0.188415878 0.404949192
[16] -0.967709979 0.143167683 -0.798238354 -0.865693635 2.140791650
[21] 0.485892240 0.190472153 0.609979874 -0.472992320 0.510850615
[26] -2.413861429 0.088786128 -1.602594468 1.573705431 0.874311934
[31] 0.503895313 -0.481074784 0.271932926 -1.383304202 -0.478284001
[36] 0.888613782 -0.528598069 -0.950128624 0.758069882 0.377443209
[41] -0.045982378 -1.178440595 -1.009526318 -0.020445748 0.170173834
[46] -0.713842700 1.579968143 0.697667956 0.796690225 -0.301557624
[51] 0.282583508 -1.454658603 1.091542640 -0.508022364 -0.187136187
[56] -0.425919723 -0.007007309 -0.189404855 -0.590071066 0.580763070
[61] -0.563049473 -2.277691246 -0.039181892 -0.179959874 2.435949982
[66] 0.955433993 0.207109611 1.008819822 0.316757266 -1.260355835
[71] -0.235400921 -0.587820124 1.625232715 0.175487316 -0.281109778
[76] 1.870102026 1.888223749 0.019825371 0.472562215 0.081624461
[81] -1.127985278 0.653982099 -0.071492698 0.026288296 1.588343501
[86] 0.520476241 -0.162274711 0.729230697 -0.077682630 -1.640879017
[91] -0.538993387 0.817357899 -0.834599524 -1.126630235 0.466627237
[96] -1.227300385 -2.153114095 0.543491997 -1.336001381 -1.041348340
> rowMin(tmp2)
[1] -0.690029431 0.189067637 0.721262269 0.904323328 0.084229172
[6] -0.558225426 1.144153295 0.580063519 0.366488596 -0.100491290
[11] 0.208214481 0.177006435 1.474052169 0.188415878 0.404949192
[16] -0.967709979 0.143167683 -0.798238354 -0.865693635 2.140791650
[21] 0.485892240 0.190472153 0.609979874 -0.472992320 0.510850615
[26] -2.413861429 0.088786128 -1.602594468 1.573705431 0.874311934
[31] 0.503895313 -0.481074784 0.271932926 -1.383304202 -0.478284001
[36] 0.888613782 -0.528598069 -0.950128624 0.758069882 0.377443209
[41] -0.045982378 -1.178440595 -1.009526318 -0.020445748 0.170173834
[46] -0.713842700 1.579968143 0.697667956 0.796690225 -0.301557624
[51] 0.282583508 -1.454658603 1.091542640 -0.508022364 -0.187136187
[56] -0.425919723 -0.007007309 -0.189404855 -0.590071066 0.580763070
[61] -0.563049473 -2.277691246 -0.039181892 -0.179959874 2.435949982
[66] 0.955433993 0.207109611 1.008819822 0.316757266 -1.260355835
[71] -0.235400921 -0.587820124 1.625232715 0.175487316 -0.281109778
[76] 1.870102026 1.888223749 0.019825371 0.472562215 0.081624461
[81] -1.127985278 0.653982099 -0.071492698 0.026288296 1.588343501
[86] 0.520476241 -0.162274711 0.729230697 -0.077682630 -1.640879017
[91] -0.538993387 0.817357899 -0.834599524 -1.126630235 0.466627237
[96] -1.227300385 -2.153114095 0.543491997 -1.336001381 -1.041348340
>
> colMeans(tmp2)
[1] 0.01776342
> colSums(tmp2)
[1] 1.776342
> colVars(tmp2)
[1] 0.8938425
> colSd(tmp2)
[1] 0.9454324
> colMax(tmp2)
[1] 2.43595
> colMin(tmp2)
[1] -2.413861
> colMedians(tmp2)
[1] 0.08292682
> colRanges(tmp2)
[,1]
[1,] -2.413861
[2,] 2.435950
>
> 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.0120614 -4.8494629 2.4778689 4.5564003 -2.0094275 5.0491896
[7] 1.2851673 -0.1762347 -4.3785749 7.4802237
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.5985452
[2,] -0.9717647
[3,] -0.4706072
[4,] 0.9736039
[5,] 1.6927088
>
> rowApply(tmp,sum)
[1] -1.44785796 -4.68006872 4.20863732 1.68458077 -0.67892109 0.02164163
[7] 0.75893227 1.68406961 8.83693393 -1.96485926
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 5 4 10 7 1 7 1 3 5 3
[2,] 2 1 4 4 2 6 5 1 10 9
[3,] 9 8 6 3 7 9 6 8 4 1
[4,] 10 5 9 2 5 10 7 2 7 10
[5,] 6 7 1 6 3 2 10 5 3 8
[6,] 1 3 7 10 10 8 9 6 9 4
[7,] 3 10 3 9 8 3 2 7 1 6
[8,] 8 2 5 5 4 1 4 10 8 2
[9,] 4 9 2 1 6 4 3 4 2 7
[10,] 7 6 8 8 9 5 8 9 6 5
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.6966549 1.0709123 -1.6179947 4.3222811 -3.3404632 -1.8817426
[7] 0.2747748 -0.9955187 -0.5169691 0.6633338 -0.2677682 0.9433638
[13] -3.2816425 0.3236818 1.7013680 -2.4146118 2.4161271 -0.6473926
[19] 2.7940598 -0.8353303
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.92128847
[2,] -0.08550092
[3,] 0.18023524
[4,] 0.47844368
[5,] 1.04476532
>
> rowApply(tmp,sum)
[1] -1.824010 5.121168 -9.572219 1.008916 4.673270
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 20 12 13 4 7
[2,] 17 4 19 5 14
[3,] 16 7 2 20 1
[4,] 9 19 20 14 16
[5,] 14 6 10 1 2
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1.04476532 0.6551913 0.5470610 -0.1358331 0.1195803 -1.46486949
[2,] 0.47844368 -0.5551422 -0.2288869 1.7294228 -0.3128044 -0.48924937
[3,] -0.08550092 1.1946158 -2.3450201 1.4952996 -0.7901059 0.09171432
[4,] -0.92128847 -0.8244627 1.5360214 0.5470257 -1.3605350 -0.39971207
[5,] 0.18023524 0.6007101 -1.1271701 0.6863662 -0.9965982 0.38037399
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.7096071 0.01768302 -0.4734259 -1.04313325 -0.2922739 -0.02705572
[2,] -0.6361122 0.58847094 1.6930366 -0.01090999 0.1688919 0.85158399
[3,] -0.1266836 -2.64363798 -1.5048256 1.07304652 -0.8265258 -1.24975674
[4,] 0.1070240 1.26986669 0.2235358 1.06299183 0.3746016 0.62712911
[5,] 0.2209395 -0.22790133 -0.4552900 -0.41866136 0.3075380 0.74146314
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.8098708 0.05214656 0.4608071 -0.6022157 -0.9594928 -0.6438994
[2,] 0.1113051 -1.44212077 1.3179913 -2.2662007 1.3483126 0.7202386
[3,] -1.6331674 0.09327954 -1.1020056 -0.2152405 0.9990073 0.2995272
[4,] -0.2444011 0.95424472 0.4728370 -0.3932451 -0.2593558 -1.2216861
[5,] -0.7055083 0.66613171 0.5517382 1.0622901 1.2876558 0.1984270
[,19] [,20]
[1,] 0.05298052 0.968238
[2,] 1.76053692 0.294360
[3,] -1.00653194 -1.289708
[4,] 0.74869631 -1.290372
[5,] 1.23837798 0.482152
>
>
> 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.24-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.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 647 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 562 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 -1.461706 1.430329 -0.2300444 -0.7695831 0.547101 0.8962827 0.4582143
col8 col9 col10 col11 col12 col13 col14
row1 -0.2883782 1.612586 -0.3133889 -0.1882341 0.2735553 -1.405074 0.4449864
col15 col16 col17 col18 col19 col20
row1 -1.709442 -0.926121 -0.7904655 -0.5107558 -2.262387 -0.5983665
> tmp[,"col10"]
col10
row1 -0.31338893
row2 0.02156724
row3 1.51253108
row4 1.07120128
row5 -0.27338187
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -1.461706 1.430329 -0.2300444 -0.7695831 0.547101 0.8962827 0.4582143
row5 -0.532247 1.693498 0.3361160 0.4726784 -0.232629 -0.5454952 -1.7191958
col8 col9 col10 col11 col12 col13
row1 -0.2883782 1.612586 -0.3133889 -0.1882341 0.27355529 -1.4050739
row5 0.6574591 -1.178182 -0.2733819 0.2835342 -0.03650969 0.7080776
col14 col15 col16 col17 col18 col19 col20
row1 0.4449864 -1.7094417 -0.926121 -0.7904655 -0.5107558 -2.2623874 -0.5983665
row5 1.4621524 0.2374862 -1.006285 0.3384546 -0.5675197 0.1428026 0.6271699
> tmp[,c("col6","col20")]
col6 col20
row1 0.8962827 -0.5983665
row2 0.1017502 0.2284391
row3 -0.9796161 1.6568804
row4 -0.0427310 -0.3564359
row5 -0.5454952 0.6271699
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.8962827 -0.5983665
row5 -0.5454952 0.6271699
>
>
>
>
> 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 51.1418 51.17071 52.19229 50.84878 50.35928 104.7531 50.74975 48.23106
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.66963 50.6034 49.80172 49.99788 51.46724 49.47379 50.48448 50.09631
col17 col18 col19 col20
row1 50.77152 48.40657 49.37557 104.304
> tmp[,"col10"]
col10
row1 50.60340
row2 31.85944
row3 29.10710
row4 28.96038
row5 49.92409
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 51.14180 51.17071 52.19229 50.84878 50.35928 104.7531 50.74975 48.23106
row5 50.31791 48.79006 49.82974 49.31584 51.25285 105.1705 51.18052 49.50091
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.66963 50.60340 49.80172 49.99788 51.46724 49.47379 50.48448 50.09631
row5 50.11569 49.92409 49.64155 49.57275 50.36579 49.43077 50.17959 50.47785
col17 col18 col19 col20
row1 50.77152 48.40657 49.37557 104.3040
row5 50.12993 50.33439 50.26026 106.4569
> tmp[,c("col6","col20")]
col6 col20
row1 104.75307 104.30400
row2 75.10408 73.85644
row3 75.21966 72.54993
row4 74.50866 74.43097
row5 105.17050 106.45687
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.7531 104.3040
row5 105.1705 106.4569
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.7531 104.3040
row5 105.1705 106.4569
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -1.87273963
[2,] 0.41677646
[3,] 0.02824053
[4,] 0.99418160
[5,] -0.57122651
> tmp[,c("col17","col7")]
col17 col7
[1,] 1.0383057 1.5811413
[2,] -1.1781494 0.1328306
[3,] -0.1472269 -2.2396342
[4,] 0.2427791 1.4238075
[5,] 2.4092381 0.2289485
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.3713609 1.4260526
[2,] -1.2270015 0.1856712
[3,] -0.8583351 1.4343333
[4,] 1.2485066 -0.8469010
[5,] 2.1690389 1.6398997
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.3713609
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.3713609
[2,] -1.2270015
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row3 1.2281496 -0.6266961 -1.666872 -0.7020617 -1.2731526 -0.40733406
row1 0.4207016 1.6928493 2.020225 -1.1471979 -0.2919051 -0.07095233
[,7] [,8] [,9] [,10] [,11] [,12]
row3 -1.28538630 -1.688353 -0.4459699 -0.02490016 0.1589928 0.7323979
row1 -0.08058509 -1.219235 0.9874915 -1.88380395 0.7259724 0.9836214
[,13] [,14] [,15] [,16] [,17] [,18]
row3 -0.8904058 0.26634121 0.2514644 0.60914181 -2.716190 0.1733113
row1 0.6421790 0.01348003 0.9392459 -0.04416755 -0.201097 -0.2152897
[,19] [,20]
row3 -0.3468001 -0.56720212
row1 1.0470491 -0.08391331
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.5583585 0.42731 -1.226797 0.5969317 -0.2360179 -1.482951 0.3171627
[,8] [,9] [,10]
row2 0.8418631 -0.60127 1.897002
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.1886443 2.510847 -0.08330993 -0.489296 -0.5754848 -0.2498804 0.2719534
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.1075304 1.744171 -0.3735029 -0.4801822 0.9050605 -0.4052623 0.2868153
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -1.407309 -3.000944 -1.783836 0.3307891 -0.065536 -2.236902
>
>
> 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: 0x59f0cd97fd30>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMff3405b54bab2"
[2] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMff34076c7779b"
[3] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMff3405c19560b"
[4] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMff34038a423ed"
[5] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMff34042e08abb"
[6] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMff3405ed45e3d"
[7] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMff34046fb1a45"
[8] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMff34046b6d7ab"
[9] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMff34076c9fd4d"
[10] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMff340587d87ef"
[11] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMff340ba7c2ce"
[12] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMff34059a9a9c2"
[13] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMff34015c7cf64"
[14] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMff340270969c9"
[15] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMff340477c3477"
>
>
> ### 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: 0x59f0cf1b1f60>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x59f0cf1b1f60>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x59f0cf1b1f60>
> rowMedians(tmp)
[1] -0.6281021583 0.1837806942 0.1587973600 -0.2105533831 -0.1448112229
[6] -0.1013733651 -0.2288754323 -0.3146497425 0.1813270899 -0.4454827066
[11] -0.7071963910 -0.3171640961 -0.0197130450 0.0883407867 -0.1555837981
[16] -0.3744853886 0.1163952684 0.1060725779 -0.2999693341 0.1156327861
[21] 0.3098314178 -0.0639094228 0.2519495194 -0.0020294163 -0.1573890294
[26] -0.5717036298 -0.2296541785 -0.1895944580 -0.6631156204 0.1648394248
[31] -0.3454454963 0.0356194173 0.3399323184 0.4693225560 -0.0990021020
[36] 0.1123242634 -0.1516201945 0.7424867383 0.2306910010 -0.3563646420
[41] -0.2696818819 -0.3586720651 0.3188381362 0.3503287109 -0.1359432977
[46] 0.3518330200 0.0226669500 -0.0947586565 -0.5470868152 -0.0142745492
[51] 0.1013888149 -0.0724505811 -0.2206449006 -0.2388096277 -0.2681973405
[56] -0.2816319134 -0.0195496592 -0.3190827847 0.2040656445 0.3188419798
[61] -0.0825428289 -0.2017494996 -0.4139680644 -0.2157559163 0.1676056844
[66] 0.0845731728 -0.1133409289 -0.0192121083 0.1377995706 -0.2425993837
[71] 0.3929661116 0.2368293221 -0.2710290132 -0.2551442814 -0.1842261963
[76] -0.3691013749 0.2859092123 -0.2235479264 0.2333799525 0.6165803185
[81] 0.2158430633 -0.1829597820 -0.3051590239 0.3155542703 -0.2768056423
[86] -0.1004870025 -0.0232204216 -0.6194886853 0.2449810790 -0.3233776535
[91] 0.2148227838 0.1140079204 -0.4039298496 -0.3170304629 0.0156917456
[96] -0.2643880610 0.0571696131 -0.5151916071 -0.2465025552 0.6226500878
[101] 0.0185011268 0.0004294009 -0.2994062853 0.5094489649 0.7870682783
[106] -0.1248196861 -0.4441813836 -0.7438135873 0.8405950229 0.1093934247
[111] 0.3006594907 0.1072366340 -0.1374255326 -0.0642165337 0.0914499178
[116] -0.1746966506 -0.1287249871 -0.9940692422 -0.0076347419 0.1174582289
[121] -0.0538230456 0.1139490092 -0.2693648418 -0.7344966305 0.3512260174
[126] -0.0776174568 0.2292982111 0.6310137263 -0.2016041018 -0.3842244861
[131] -0.3237929090 -0.1981519217 0.2118608527 -0.2503936136 -0.0008793465
[136] -0.0228516891 0.4331446482 0.1072889642 0.1766147208 -0.2699297549
[141] -0.5874352172 0.4040308024 -0.5847173300 0.1018331266 0.6205490901
[146] -0.4344048914 -0.1622774158 0.5648075058 0.2619328809 0.0172001165
[151] -0.2546764670 -0.5017508250 0.2502240530 0.3244003216 -0.2501053878
[156] 0.1161202282 0.0290083738 -0.2465968723 0.1496514632 -0.1033899044
[161] -0.3741895538 0.0731403375 -0.5420926497 0.2333397157 -0.2295382913
[166] 0.0408819746 0.6050673548 0.1710078184 -0.7766778729 0.1737122738
[171] -0.1019626857 -0.1718415500 -0.5930382393 -0.1297318039 0.5785208104
[176] 0.1529916508 0.5537906801 0.2799799334 -0.0725598134 -0.0349773687
[181] -0.1537404598 0.3773483531 0.0841302034 -0.2918203959 -0.1167114737
[186] -0.0240716588 0.3401653772 -0.1868751374 -0.2844545328 0.0443076173
[191] 0.0674242545 -0.0678779264 -0.3472760307 0.1774551633 0.3235023121
[196] -0.4487328755 -0.2337234739 -0.1598086743 -0.6719239294 -0.1244449416
[201] -0.0633075905 -0.3485697714 0.2780794654 -0.2217363616 -0.0463674546
[206] -0.3793366790 0.2195783428 0.4801439084 0.0699704459 0.1907662110
[211] 0.2480006916 0.0299620427 -0.1934673319 0.1187051160 -0.4246307676
[216] -0.4482766418 -0.0650705991 -0.4007344911 -0.4939078495 0.3756026504
[221] 0.0533135642 -0.4282456740 0.5075339945 -0.0324220034 -0.0060270109
[226] 0.3118135940 0.3099449922 -0.1546940219 0.1118031855 0.7139732795
>
> proc.time()
user system elapsed
1.259 0.698 1.949
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
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: 0x60c46bea0520>
> .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: 0x60c46bea0520>
> .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: 0x60c46bea0520>
> .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: 0x60c46bea0520>
> 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: 0x60c46ba49f60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60c46ba49f60>
> .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: 0x60c46ba49f60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60c46ba49f60>
> .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: 0x60c46ba49f60>
> 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: 0x60c46c5f3b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60c46c5f3b40>
> .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: 0x60c46c5f3b40>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60c46c5f3b40>
> .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: 0x60c46c5f3b40>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x60c46c5f3b40>
> .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: 0x60c46c5f3b40>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x60c46c5f3b40>
> .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: 0x60c46c5f3b40>
> 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: 0x60c46c630bc0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x60c46c630bc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60c46c630bc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60c46c630bc0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFileff411417ab090" "BufferedMatrixFileff4116a7aa10c"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFileff411417ab090" "BufferedMatrixFileff4116a7aa10c"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x60c46c5ca000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60c46c5ca000>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60c46c5ca000>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60c46c5ca000>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x60c46c5ca000>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x60c46c5ca000>
> .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: 0x60c46b6fde30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60c46b6fde30>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60c46b6fde30>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x60c46b6fde30>
> 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: 0x60c46bd27a50>
> .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: 0x60c46bd27a50>
> rm(P)
>
> proc.time()
user system elapsed
0.249 0.052 0.291
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
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.251 0.053 0.292