| Back to Build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-02-14 11:32 -0500 (Sat, 14 Feb 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences" | 4864 |
| 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/2352 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| See other builds for BufferedMatrix in R Universe. | ||||||||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.75.0 |
| Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz |
| StartedAt: 2026-02-13 21:56:43 -0500 (Fri, 13 Feb 2026) |
| EndedAt: 2026-02-13 21:57:08 -0500 (Fri, 13 Feb 2026) |
| EllapsedTime: 25.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2026-01-15 r89304)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE
Status: 1 NOTE
See
‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.23-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
1580 | if (!(Matrix->readonly) & setting){
| ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
3327 | static int sort_double(const double *a1,const double *a2){
| ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.23-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.23-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.23-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.253 0.046 0.289
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] "Fri Feb 13 21:56:58 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] "Fri Feb 13 21:56:58 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: 0x5f141f0eac10>
>
>
>
> 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] "Fri Feb 13 21:56:59 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] "Fri Feb 13 21:56:59 2026"
>
> ColMode(tmp2)
<pointer: 0x5f141f0eac10>
>
>
>
> ### 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.4975243 0.5872617 0.2966560 0.3204947
[2,] 0.8312047 1.3553759 0.5665442 1.4492197
[3,] 1.1628918 -1.0465914 2.3334605 -0.4362659
[4,] 0.4930713 -0.9018246 0.6306396 0.4689416
> 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.4975243 0.5872617 0.2966560 0.3204947
[2,] 0.8312047 1.3553759 0.5665442 1.4492197
[3,] 1.1628918 1.0465914 2.3334605 0.4362659
[4,] 0.4930713 0.9018246 0.6306396 0.4689416
> 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.9748446 0.7663300 0.5446614 0.5661226
[2,] 0.9117043 1.1642061 0.7526913 1.2038354
[3,] 1.0783746 1.0230305 1.5275669 0.6605043
[4,] 0.7021904 0.9496445 0.7941282 0.6847931
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 224.24597 33.25056 30.74327 30.98172
[2,] 34.94825 37.99744 33.09346 38.48757
[3,] 36.94664 36.27690 42.60913 32.04131
[4,] 32.51498 35.39827 33.57192 32.31687
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5f141ff41ff0>
> exp(tmp5)
<pointer: 0x5f141ff41ff0>
> log(tmp5,2)
<pointer: 0x5f141ff41ff0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.7386
> Min(tmp5)
[1] 52.9447
> mean(tmp5)
[1] 72.73262
> Sum(tmp5)
[1] 14546.52
> Var(tmp5)
[1] 849.8461
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.16975 69.49651 72.55499 69.78917 71.50170 72.64577 69.70647 71.10440
[9] 70.01411 69.34332
> rowSums(tmp5)
[1] 1823.395 1389.930 1451.100 1395.783 1430.034 1452.915 1394.129 1422.088
[9] 1400.282 1386.866
> rowVars(tmp5)
[1] 7887.61251 74.64087 56.64078 52.30282 37.23594 47.76413
[7] 97.61825 100.43595 60.76466 74.10428
> rowSd(tmp5)
[1] 88.812232 8.639495 7.526007 7.232069 6.102126 6.911160 9.880195
[8] 10.021774 7.795169 8.608384
> rowMax(tmp5)
[1] 466.73861 90.82516 88.68532 85.95252 81.74593 84.40141 87.95214
[8] 88.73633 83.95347 89.69781
> rowMin(tmp5)
[1] 58.57282 55.22643 56.84141 60.57315 57.30486 56.56864 52.94470 53.79512
[9] 56.74400 58.66571
>
> colMeans(tmp5)
[1] 111.88337 71.44631 70.81221 70.81895 68.12984 75.43544 72.15003
[8] 71.96956 72.82509 68.03891 70.43648 68.81121 67.61363 68.49700
[15] 73.55373 72.52215 65.17896 72.65206 70.58378 71.29367
> colSums(tmp5)
[1] 1118.8337 714.4631 708.1221 708.1895 681.2984 754.3544 721.5003
[8] 719.6956 728.2509 680.3891 704.3648 688.1121 676.1363 684.9700
[15] 735.5373 725.2215 651.7896 726.5206 705.8378 712.9367
> colVars(tmp5)
[1] 15608.26988 48.32726 55.81832 25.27876 61.85679 79.32125
[7] 83.80764 52.42179 94.89607 38.43420 52.68131 34.30267
[13] 29.31713 72.23087 69.04305 122.70951 114.68958 103.25776
[19] 84.49500 45.99116
> colSd(tmp5)
[1] 124.933062 6.951781 7.471166 5.027799 7.864909 8.906248
[7] 9.154651 7.240289 9.741461 6.199532 7.258189 5.856848
[13] 5.414530 8.498874 8.309215 11.077433 10.709322 10.161582
[19] 9.192116 6.781678
> colMax(tmp5)
[1] 466.73861 81.74593 88.68532 80.10684 77.09794 86.78072 89.69781
[8] 83.23857 82.57420 75.78379 80.96245 73.69004 76.30782 77.60545
[15] 84.40141 85.95252 90.82516 87.95214 88.73633 80.50225
> colMin(tmp5)
[1] 56.56864 59.61498 63.01405 64.48439 56.74400 61.76073 58.69216 60.14300
[9] 55.22643 57.87571 60.57315 54.16932 57.97557 53.79512 61.23784 52.94470
[17] 56.84141 60.34896 60.66815 62.19185
>
>
> ### 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.16975 69.49651 72.55499 69.78917 71.50170 NA 69.70647 71.10440
[9] 70.01411 69.34332
> rowSums(tmp5)
[1] 1823.395 1389.930 1451.100 1395.783 1430.034 NA 1394.129 1422.088
[9] 1400.282 1386.866
> rowVars(tmp5)
[1] 7887.61251 74.64087 56.64078 52.30282 37.23594 50.33885
[7] 97.61825 100.43595 60.76466 74.10428
> rowSd(tmp5)
[1] 88.812232 8.639495 7.526007 7.232069 6.102126 7.094988 9.880195
[8] 10.021774 7.795169 8.608384
> rowMax(tmp5)
[1] 466.73861 90.82516 88.68532 85.95252 81.74593 NA 87.95214
[8] 88.73633 83.95347 89.69781
> rowMin(tmp5)
[1] 58.57282 55.22643 56.84141 60.57315 57.30486 NA 52.94470 53.79512
[9] 56.74400 58.66571
>
> colMeans(tmp5)
[1] 111.88337 71.44631 70.81221 70.81895 68.12984 75.43544 72.15003
[8] 71.96956 NA 68.03891 70.43648 68.81121 67.61363 68.49700
[15] 73.55373 72.52215 65.17896 72.65206 70.58378 71.29367
> colSums(tmp5)
[1] 1118.8337 714.4631 708.1221 708.1895 681.2984 754.3544 721.5003
[8] 719.6956 NA 680.3891 704.3648 688.1121 676.1363 684.9700
[15] 735.5373 725.2215 651.7896 726.5206 705.8378 712.9367
> colVars(tmp5)
[1] 15608.26988 48.32726 55.81832 25.27876 61.85679 79.32125
[7] 83.80764 52.42179 NA 38.43420 52.68131 34.30267
[13] 29.31713 72.23087 69.04305 122.70951 114.68958 103.25776
[19] 84.49500 45.99116
> colSd(tmp5)
[1] 124.933062 6.951781 7.471166 5.027799 7.864909 8.906248
[7] 9.154651 7.240289 NA 6.199532 7.258189 5.856848
[13] 5.414530 8.498874 8.309215 11.077433 10.709322 10.161582
[19] 9.192116 6.781678
> colMax(tmp5)
[1] 466.73861 81.74593 88.68532 80.10684 77.09794 86.78072 89.69781
[8] 83.23857 NA 75.78379 80.96245 73.69004 76.30782 77.60545
[15] 84.40141 85.95252 90.82516 87.95214 88.73633 80.50225
> colMin(tmp5)
[1] 56.56864 59.61498 63.01405 64.48439 56.74400 61.76073 58.69216 60.14300
[9] NA 57.87571 60.57315 54.16932 57.97557 53.79512 61.23784 52.94470
[17] 56.84141 60.34896 60.66815 62.19185
>
> Max(tmp5,na.rm=TRUE)
[1] 466.7386
> Min(tmp5,na.rm=TRUE)
[1] 52.9447
> mean(tmp5,na.rm=TRUE)
[1] 72.72722
> Sum(tmp5,na.rm=TRUE)
[1] 14472.72
> Var(tmp5,na.rm=TRUE)
[1] 854.1324
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.16975 69.49651 72.55499 69.78917 71.50170 72.58466 69.70647 71.10440
[9] 70.01411 69.34332
> rowSums(tmp5,na.rm=TRUE)
[1] 1823.395 1389.930 1451.100 1395.783 1430.034 1379.108 1394.129 1422.088
[9] 1400.282 1386.866
> rowVars(tmp5,na.rm=TRUE)
[1] 7887.61251 74.64087 56.64078 52.30282 37.23594 50.33885
[7] 97.61825 100.43595 60.76466 74.10428
> rowSd(tmp5,na.rm=TRUE)
[1] 88.812232 8.639495 7.526007 7.232069 6.102126 7.094988 9.880195
[8] 10.021774 7.795169 8.608384
> rowMax(tmp5,na.rm=TRUE)
[1] 466.73861 90.82516 88.68532 85.95252 81.74593 84.40141 87.95214
[8] 88.73633 83.95347 89.69781
> rowMin(tmp5,na.rm=TRUE)
[1] 58.57282 55.22643 56.84141 60.57315 57.30486 56.56864 52.94470 53.79512
[9] 56.74400 58.66571
>
> colMeans(tmp5,na.rm=TRUE)
[1] 111.88337 71.44631 70.81221 70.81895 68.12984 75.43544 72.15003
[8] 71.96956 72.71601 68.03891 70.43648 68.81121 67.61363 68.49700
[15] 73.55373 72.52215 65.17896 72.65206 70.58378 71.29367
> colSums(tmp5,na.rm=TRUE)
[1] 1118.8337 714.4631 708.1221 708.1895 681.2984 754.3544 721.5003
[8] 719.6956 654.4441 680.3891 704.3648 688.1121 676.1363 684.9700
[15] 735.5373 725.2215 651.7896 726.5206 705.8378 712.9367
> colVars(tmp5,na.rm=TRUE)
[1] 15608.26988 48.32726 55.81832 25.27876 61.85679 79.32125
[7] 83.80764 52.42179 106.62421 38.43420 52.68131 34.30267
[13] 29.31713 72.23087 69.04305 122.70951 114.68958 103.25776
[19] 84.49500 45.99116
> colSd(tmp5,na.rm=TRUE)
[1] 124.933062 6.951781 7.471166 5.027799 7.864909 8.906248
[7] 9.154651 7.240289 10.325900 6.199532 7.258189 5.856848
[13] 5.414530 8.498874 8.309215 11.077433 10.709322 10.161582
[19] 9.192116 6.781678
> colMax(tmp5,na.rm=TRUE)
[1] 466.73861 81.74593 88.68532 80.10684 77.09794 86.78072 89.69781
[8] 83.23857 82.57420 75.78379 80.96245 73.69004 76.30782 77.60545
[15] 84.40141 85.95252 90.82516 87.95214 88.73633 80.50225
> colMin(tmp5,na.rm=TRUE)
[1] 56.56864 59.61498 63.01405 64.48439 56.74400 61.76073 58.69216 60.14300
[9] 55.22643 57.87571 60.57315 54.16932 57.97557 53.79512 61.23784 52.94470
[17] 56.84141 60.34896 60.66815 62.19185
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.16975 69.49651 72.55499 69.78917 71.50170 NaN 69.70647 71.10440
[9] 70.01411 69.34332
> rowSums(tmp5,na.rm=TRUE)
[1] 1823.395 1389.930 1451.100 1395.783 1430.034 0.000 1394.129 1422.088
[9] 1400.282 1386.866
> rowVars(tmp5,na.rm=TRUE)
[1] 7887.61251 74.64087 56.64078 52.30282 37.23594 NA
[7] 97.61825 100.43595 60.76466 74.10428
> rowSd(tmp5,na.rm=TRUE)
[1] 88.812232 8.639495 7.526007 7.232069 6.102126 NA 9.880195
[8] 10.021774 7.795169 8.608384
> rowMax(tmp5,na.rm=TRUE)
[1] 466.73861 90.82516 88.68532 85.95252 81.74593 NA 87.95214
[8] 88.73633 83.95347 89.69781
> rowMin(tmp5,na.rm=TRUE)
[1] 58.57282 55.22643 56.84141 60.57315 57.30486 NA 52.94470 53.79512
[9] 56.74400 58.66571
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 118.02945 70.95396 70.58448 70.40723 68.02348 74.48293 72.64266
[8] 71.94916 NaN 67.49544 69.26693 68.95311 67.08698 68.47251
[15] 72.34843 72.08552 65.23369 71.57100 70.78101 71.76141
> colSums(tmp5,na.rm=TRUE)
[1] 1062.2650 638.5856 635.2603 633.6651 612.2113 670.3464 653.7839
[8] 647.5424 0.0000 607.4590 623.4024 620.5780 603.7828 616.2526
[15] 651.1359 648.7697 587.1032 644.1390 637.0291 645.8527
> colVars(tmp5,na.rm=TRUE)
[1] 17134.34273 51.64103 62.21218 26.53155 69.46163 79.02963
[7] 91.55345 58.96983 NA 39.91572 43.87814 38.36399
[13] 29.86142 81.25298 61.33009 135.90345 128.99208 103.01722
[19] 94.61924 49.27873
> colSd(tmp5,na.rm=TRUE)
[1] 130.898215 7.186170 7.887470 5.150879 8.334365 8.889861
[7] 9.568357 7.679181 NA 6.317889 6.624058 6.193867
[13] 5.464560 9.014044 7.831353 11.657763 11.357468 10.149740
[19] 9.727242 7.019881
> colMax(tmp5,na.rm=TRUE)
[1] 466.73861 81.74593 88.68532 80.10684 77.09794 86.78072 89.69781
[8] 83.23857 -Inf 75.78379 80.27118 73.69004 76.30782 77.60545
[15] 80.39428 85.95252 90.82516 87.95214 88.73633 80.50225
> colMin(tmp5,na.rm=TRUE)
[1] 67.42822 59.61498 63.01405 64.48439 56.74400 61.76073 58.69216 60.14300
[9] Inf 57.87571 60.57315 54.16932 57.97557 53.79512 61.23784 52.94470
[17] 56.84141 60.34896 60.66815 62.19185
>
>
>
>
> 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] 334.2381 286.6026 256.8964 192.3593 175.5494 115.8573 127.7025 342.6999
[9] 121.0817 196.9939
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 334.2381 286.6026 256.8964 192.3593 175.5494 115.8573 127.7025 342.6999
[9] 121.0817 196.9939
>
>
>
> 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] 1.136868e-13 5.684342e-14 5.684342e-14 1.705303e-13 1.136868e-13
[6] -5.684342e-14 -8.526513e-14 1.136868e-13 8.526513e-14 -1.136868e-13
[11] 0.000000e+00 1.705303e-13 -2.842171e-14 0.000000e+00 5.684342e-14
[16] 2.842171e-14 0.000000e+00 2.273737e-13 -2.842171e-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)
+ }
10 1
1 7
8 16
5 3
7 19
7 16
2 1
4 4
2 12
5 10
5 13
9 7
7 9
10 6
6 5
9 10
3 19
4 9
4 1
9 5
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.290409
> Min(tmp)
[1] -2.462652
> mean(tmp)
[1] -0.04370141
> Sum(tmp)
[1] -4.370141
> Var(tmp)
[1] 1.180406
>
> rowMeans(tmp)
[1] -0.04370141
> rowSums(tmp)
[1] -4.370141
> rowVars(tmp)
[1] 1.180406
> rowSd(tmp)
[1] 1.086465
> rowMax(tmp)
[1] 2.290409
> rowMin(tmp)
[1] -2.462652
>
> colMeans(tmp)
[1] -0.546719823 -1.739661803 0.453313831 -0.240562845 -2.462652296
[6] -1.037268674 1.613467483 0.742192990 0.353748076 0.082224109
[11] -0.071151785 -1.850807480 -2.163118280 0.832215726 0.064374258
[16] -0.809491241 -2.027918557 0.678990660 2.067752906 0.426337188
[21] -0.105834897 0.819540866 -0.890268907 0.426970184 0.820736074
[26] -0.440732658 0.401974756 -1.470886336 0.707692544 -0.753930391
[31] 2.004685308 -0.551236792 0.355103026 -0.124344173 0.671254950
[36] 0.457226391 1.256224990 -0.714971884 -0.842040239 -1.429798491
[41] -0.390053820 2.290409496 -0.848170247 -0.457762872 -0.819110722
[46] -0.012215491 1.535049788 -1.217432067 1.283357277 0.033052895
[51] -1.586095781 -1.246651084 -0.304629771 -0.167764063 -0.621365308
[56] 1.260918397 -0.010775489 0.669004381 0.140876124 0.079953905
[61] 0.685705149 -0.217262308 -2.191687197 -0.534546316 0.095019391
[66] 1.822418405 -1.895868602 -0.911430763 0.044761096 -0.107773895
[71] 0.245901090 0.243475258 0.286054585 -0.814848595 -0.721136870
[76] 0.967474562 1.845260721 -0.762257574 -1.112343325 0.450567038
[81] -1.760243182 0.338251223 0.352386779 -0.044460381 2.132790430
[86] -1.557347779 -0.935502922 -1.115265796 -1.288894289 0.877209819
[91] 0.493370805 1.109689034 0.136825361 -0.991493424 0.003376491
[96] 1.610112462 0.647296125 2.010674350 1.972411402 -0.352033287
> colSums(tmp)
[1] -0.546719823 -1.739661803 0.453313831 -0.240562845 -2.462652296
[6] -1.037268674 1.613467483 0.742192990 0.353748076 0.082224109
[11] -0.071151785 -1.850807480 -2.163118280 0.832215726 0.064374258
[16] -0.809491241 -2.027918557 0.678990660 2.067752906 0.426337188
[21] -0.105834897 0.819540866 -0.890268907 0.426970184 0.820736074
[26] -0.440732658 0.401974756 -1.470886336 0.707692544 -0.753930391
[31] 2.004685308 -0.551236792 0.355103026 -0.124344173 0.671254950
[36] 0.457226391 1.256224990 -0.714971884 -0.842040239 -1.429798491
[41] -0.390053820 2.290409496 -0.848170247 -0.457762872 -0.819110722
[46] -0.012215491 1.535049788 -1.217432067 1.283357277 0.033052895
[51] -1.586095781 -1.246651084 -0.304629771 -0.167764063 -0.621365308
[56] 1.260918397 -0.010775489 0.669004381 0.140876124 0.079953905
[61] 0.685705149 -0.217262308 -2.191687197 -0.534546316 0.095019391
[66] 1.822418405 -1.895868602 -0.911430763 0.044761096 -0.107773895
[71] 0.245901090 0.243475258 0.286054585 -0.814848595 -0.721136870
[76] 0.967474562 1.845260721 -0.762257574 -1.112343325 0.450567038
[81] -1.760243182 0.338251223 0.352386779 -0.044460381 2.132790430
[86] -1.557347779 -0.935502922 -1.115265796 -1.288894289 0.877209819
[91] 0.493370805 1.109689034 0.136825361 -0.991493424 0.003376491
[96] 1.610112462 0.647296125 2.010674350 1.972411402 -0.352033287
> 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.546719823 -1.739661803 0.453313831 -0.240562845 -2.462652296
[6] -1.037268674 1.613467483 0.742192990 0.353748076 0.082224109
[11] -0.071151785 -1.850807480 -2.163118280 0.832215726 0.064374258
[16] -0.809491241 -2.027918557 0.678990660 2.067752906 0.426337188
[21] -0.105834897 0.819540866 -0.890268907 0.426970184 0.820736074
[26] -0.440732658 0.401974756 -1.470886336 0.707692544 -0.753930391
[31] 2.004685308 -0.551236792 0.355103026 -0.124344173 0.671254950
[36] 0.457226391 1.256224990 -0.714971884 -0.842040239 -1.429798491
[41] -0.390053820 2.290409496 -0.848170247 -0.457762872 -0.819110722
[46] -0.012215491 1.535049788 -1.217432067 1.283357277 0.033052895
[51] -1.586095781 -1.246651084 -0.304629771 -0.167764063 -0.621365308
[56] 1.260918397 -0.010775489 0.669004381 0.140876124 0.079953905
[61] 0.685705149 -0.217262308 -2.191687197 -0.534546316 0.095019391
[66] 1.822418405 -1.895868602 -0.911430763 0.044761096 -0.107773895
[71] 0.245901090 0.243475258 0.286054585 -0.814848595 -0.721136870
[76] 0.967474562 1.845260721 -0.762257574 -1.112343325 0.450567038
[81] -1.760243182 0.338251223 0.352386779 -0.044460381 2.132790430
[86] -1.557347779 -0.935502922 -1.115265796 -1.288894289 0.877209819
[91] 0.493370805 1.109689034 0.136825361 -0.991493424 0.003376491
[96] 1.610112462 0.647296125 2.010674350 1.972411402 -0.352033287
> colMin(tmp)
[1] -0.546719823 -1.739661803 0.453313831 -0.240562845 -2.462652296
[6] -1.037268674 1.613467483 0.742192990 0.353748076 0.082224109
[11] -0.071151785 -1.850807480 -2.163118280 0.832215726 0.064374258
[16] -0.809491241 -2.027918557 0.678990660 2.067752906 0.426337188
[21] -0.105834897 0.819540866 -0.890268907 0.426970184 0.820736074
[26] -0.440732658 0.401974756 -1.470886336 0.707692544 -0.753930391
[31] 2.004685308 -0.551236792 0.355103026 -0.124344173 0.671254950
[36] 0.457226391 1.256224990 -0.714971884 -0.842040239 -1.429798491
[41] -0.390053820 2.290409496 -0.848170247 -0.457762872 -0.819110722
[46] -0.012215491 1.535049788 -1.217432067 1.283357277 0.033052895
[51] -1.586095781 -1.246651084 -0.304629771 -0.167764063 -0.621365308
[56] 1.260918397 -0.010775489 0.669004381 0.140876124 0.079953905
[61] 0.685705149 -0.217262308 -2.191687197 -0.534546316 0.095019391
[66] 1.822418405 -1.895868602 -0.911430763 0.044761096 -0.107773895
[71] 0.245901090 0.243475258 0.286054585 -0.814848595 -0.721136870
[76] 0.967474562 1.845260721 -0.762257574 -1.112343325 0.450567038
[81] -1.760243182 0.338251223 0.352386779 -0.044460381 2.132790430
[86] -1.557347779 -0.935502922 -1.115265796 -1.288894289 0.877209819
[91] 0.493370805 1.109689034 0.136825361 -0.991493424 0.003376491
[96] 1.610112462 0.647296125 2.010674350 1.972411402 -0.352033287
> colMedians(tmp)
[1] -0.546719823 -1.739661803 0.453313831 -0.240562845 -2.462652296
[6] -1.037268674 1.613467483 0.742192990 0.353748076 0.082224109
[11] -0.071151785 -1.850807480 -2.163118280 0.832215726 0.064374258
[16] -0.809491241 -2.027918557 0.678990660 2.067752906 0.426337188
[21] -0.105834897 0.819540866 -0.890268907 0.426970184 0.820736074
[26] -0.440732658 0.401974756 -1.470886336 0.707692544 -0.753930391
[31] 2.004685308 -0.551236792 0.355103026 -0.124344173 0.671254950
[36] 0.457226391 1.256224990 -0.714971884 -0.842040239 -1.429798491
[41] -0.390053820 2.290409496 -0.848170247 -0.457762872 -0.819110722
[46] -0.012215491 1.535049788 -1.217432067 1.283357277 0.033052895
[51] -1.586095781 -1.246651084 -0.304629771 -0.167764063 -0.621365308
[56] 1.260918397 -0.010775489 0.669004381 0.140876124 0.079953905
[61] 0.685705149 -0.217262308 -2.191687197 -0.534546316 0.095019391
[66] 1.822418405 -1.895868602 -0.911430763 0.044761096 -0.107773895
[71] 0.245901090 0.243475258 0.286054585 -0.814848595 -0.721136870
[76] 0.967474562 1.845260721 -0.762257574 -1.112343325 0.450567038
[81] -1.760243182 0.338251223 0.352386779 -0.044460381 2.132790430
[86] -1.557347779 -0.935502922 -1.115265796 -1.288894289 0.877209819
[91] 0.493370805 1.109689034 0.136825361 -0.991493424 0.003376491
[96] 1.610112462 0.647296125 2.010674350 1.972411402 -0.352033287
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.5467198 -1.739662 0.4533138 -0.2405628 -2.462652 -1.037269 1.613467
[2,] -0.5467198 -1.739662 0.4533138 -0.2405628 -2.462652 -1.037269 1.613467
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.742193 0.3537481 0.08222411 -0.07115178 -1.850807 -2.163118 0.8322157
[2,] 0.742193 0.3537481 0.08222411 -0.07115178 -1.850807 -2.163118 0.8322157
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.06437426 -0.8094912 -2.027919 0.6789907 2.067753 0.4263372 -0.1058349
[2,] 0.06437426 -0.8094912 -2.027919 0.6789907 2.067753 0.4263372 -0.1058349
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.8195409 -0.8902689 0.4269702 0.8207361 -0.4407327 0.4019748 -1.470886
[2,] 0.8195409 -0.8902689 0.4269702 0.8207361 -0.4407327 0.4019748 -1.470886
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.7076925 -0.7539304 2.004685 -0.5512368 0.355103 -0.1243442 0.671255
[2,] 0.7076925 -0.7539304 2.004685 -0.5512368 0.355103 -0.1243442 0.671255
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.4572264 1.256225 -0.7149719 -0.8420402 -1.429798 -0.3900538 2.290409
[2,] 0.4572264 1.256225 -0.7149719 -0.8420402 -1.429798 -0.3900538 2.290409
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.8481702 -0.4577629 -0.8191107 -0.01221549 1.53505 -1.217432 1.283357
[2,] -0.8481702 -0.4577629 -0.8191107 -0.01221549 1.53505 -1.217432 1.283357
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.03305289 -1.586096 -1.246651 -0.3046298 -0.1677641 -0.6213653 1.260918
[2,] 0.03305289 -1.586096 -1.246651 -0.3046298 -0.1677641 -0.6213653 1.260918
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.01077549 0.6690044 0.1408761 0.07995391 0.6857051 -0.2172623 -2.191687
[2,] -0.01077549 0.6690044 0.1408761 0.07995391 0.6857051 -0.2172623 -2.191687
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.5345463 0.09501939 1.822418 -1.895869 -0.9114308 0.0447611 -0.1077739
[2,] -0.5345463 0.09501939 1.822418 -1.895869 -0.9114308 0.0447611 -0.1077739
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.2459011 0.2434753 0.2860546 -0.8148486 -0.7211369 0.9674746 1.845261
[2,] 0.2459011 0.2434753 0.2860546 -0.8148486 -0.7211369 0.9674746 1.845261
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.7622576 -1.112343 0.450567 -1.760243 0.3382512 0.3523868 -0.04446038
[2,] -0.7622576 -1.112343 0.450567 -1.760243 0.3382512 0.3523868 -0.04446038
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 2.13279 -1.557348 -0.9355029 -1.115266 -1.288894 0.8772098 0.4933708
[2,] 2.13279 -1.557348 -0.9355029 -1.115266 -1.288894 0.8772098 0.4933708
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 1.109689 0.1368254 -0.9914934 0.003376491 1.610112 0.6472961 2.010674
[2,] 1.109689 0.1368254 -0.9914934 0.003376491 1.610112 0.6472961 2.010674
[,99] [,100]
[1,] 1.972411 -0.3520333
[2,] 1.972411 -0.3520333
>
>
> Max(tmp2)
[1] 2.025282
> Min(tmp2)
[1] -1.584725
> mean(tmp2)
[1] 0.1048317
> Sum(tmp2)
[1] 10.48317
> Var(tmp2)
[1] 0.7949219
>
> rowMeans(tmp2)
[1] 0.7853864377 1.0070105827 -0.2646364953 1.5181316156 -0.5512349484
[6] 1.2996139364 0.0960280103 0.7598965634 -0.6379605169 0.4939688386
[11] -0.5695221195 -1.5222558918 -1.5847247558 -0.3281793580 -0.5236022398
[16] 0.3810630308 -0.6088597928 -0.7609707495 -0.1742372126 1.0828963611
[21] -1.3092999057 1.9859170835 0.3210780578 0.0059332372 -0.8712737561
[26] -0.9859875921 1.0442231125 -0.3706143380 -0.2623011550 1.1781254128
[31] 0.4610682990 0.9512898089 0.2888262615 -1.5448460113 -1.0852648757
[36] -0.7099966364 -0.9307104747 0.4274520827 -0.3059769265 0.3374067142
[41] 0.5303049013 0.4952092531 1.0573197647 1.0776350199 0.2471806163
[46] -1.0182888893 1.4357048285 1.8034430509 1.4836787314 -0.3137806993
[51] -0.5427259499 2.0252820638 -0.9066430941 -1.5281845268 0.2374493815
[56] 0.7051508259 -0.7073427891 0.1024457495 0.7405048686 -0.7931279956
[61] 0.5897716348 1.5723956590 0.1705890049 -0.4235075111 -0.3674295029
[66] 0.4597351009 -0.3343673387 -1.1188189920 0.9675934322 -0.6418628285
[71] 0.6465411775 -0.7991803153 0.8036642794 -0.9600256954 1.2709159675
[76] 1.6786636848 -0.7810679458 -0.8512471290 0.2636712145 -0.3729940811
[81] -0.6449831542 1.6591098641 0.1390586511 0.6590639078 0.1075035682
[86] 0.2645987676 0.4063338579 -0.4129985380 0.7883257007 0.1925451598
[91] -0.1468874209 -0.3944034365 1.2740715128 -0.2777384566 -1.2935874697
[96] 0.7921789395 -0.0005687176 -0.9736606526 1.3833121807 0.5347843234
> rowSums(tmp2)
[1] 0.7853864377 1.0070105827 -0.2646364953 1.5181316156 -0.5512349484
[6] 1.2996139364 0.0960280103 0.7598965634 -0.6379605169 0.4939688386
[11] -0.5695221195 -1.5222558918 -1.5847247558 -0.3281793580 -0.5236022398
[16] 0.3810630308 -0.6088597928 -0.7609707495 -0.1742372126 1.0828963611
[21] -1.3092999057 1.9859170835 0.3210780578 0.0059332372 -0.8712737561
[26] -0.9859875921 1.0442231125 -0.3706143380 -0.2623011550 1.1781254128
[31] 0.4610682990 0.9512898089 0.2888262615 -1.5448460113 -1.0852648757
[36] -0.7099966364 -0.9307104747 0.4274520827 -0.3059769265 0.3374067142
[41] 0.5303049013 0.4952092531 1.0573197647 1.0776350199 0.2471806163
[46] -1.0182888893 1.4357048285 1.8034430509 1.4836787314 -0.3137806993
[51] -0.5427259499 2.0252820638 -0.9066430941 -1.5281845268 0.2374493815
[56] 0.7051508259 -0.7073427891 0.1024457495 0.7405048686 -0.7931279956
[61] 0.5897716348 1.5723956590 0.1705890049 -0.4235075111 -0.3674295029
[66] 0.4597351009 -0.3343673387 -1.1188189920 0.9675934322 -0.6418628285
[71] 0.6465411775 -0.7991803153 0.8036642794 -0.9600256954 1.2709159675
[76] 1.6786636848 -0.7810679458 -0.8512471290 0.2636712145 -0.3729940811
[81] -0.6449831542 1.6591098641 0.1390586511 0.6590639078 0.1075035682
[86] 0.2645987676 0.4063338579 -0.4129985380 0.7883257007 0.1925451598
[91] -0.1468874209 -0.3944034365 1.2740715128 -0.2777384566 -1.2935874697
[96] 0.7921789395 -0.0005687176 -0.9736606526 1.3833121807 0.5347843234
> 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.7853864377 1.0070105827 -0.2646364953 1.5181316156 -0.5512349484
[6] 1.2996139364 0.0960280103 0.7598965634 -0.6379605169 0.4939688386
[11] -0.5695221195 -1.5222558918 -1.5847247558 -0.3281793580 -0.5236022398
[16] 0.3810630308 -0.6088597928 -0.7609707495 -0.1742372126 1.0828963611
[21] -1.3092999057 1.9859170835 0.3210780578 0.0059332372 -0.8712737561
[26] -0.9859875921 1.0442231125 -0.3706143380 -0.2623011550 1.1781254128
[31] 0.4610682990 0.9512898089 0.2888262615 -1.5448460113 -1.0852648757
[36] -0.7099966364 -0.9307104747 0.4274520827 -0.3059769265 0.3374067142
[41] 0.5303049013 0.4952092531 1.0573197647 1.0776350199 0.2471806163
[46] -1.0182888893 1.4357048285 1.8034430509 1.4836787314 -0.3137806993
[51] -0.5427259499 2.0252820638 -0.9066430941 -1.5281845268 0.2374493815
[56] 0.7051508259 -0.7073427891 0.1024457495 0.7405048686 -0.7931279956
[61] 0.5897716348 1.5723956590 0.1705890049 -0.4235075111 -0.3674295029
[66] 0.4597351009 -0.3343673387 -1.1188189920 0.9675934322 -0.6418628285
[71] 0.6465411775 -0.7991803153 0.8036642794 -0.9600256954 1.2709159675
[76] 1.6786636848 -0.7810679458 -0.8512471290 0.2636712145 -0.3729940811
[81] -0.6449831542 1.6591098641 0.1390586511 0.6590639078 0.1075035682
[86] 0.2645987676 0.4063338579 -0.4129985380 0.7883257007 0.1925451598
[91] -0.1468874209 -0.3944034365 1.2740715128 -0.2777384566 -1.2935874697
[96] 0.7921789395 -0.0005687176 -0.9736606526 1.3833121807 0.5347843234
> rowMin(tmp2)
[1] 0.7853864377 1.0070105827 -0.2646364953 1.5181316156 -0.5512349484
[6] 1.2996139364 0.0960280103 0.7598965634 -0.6379605169 0.4939688386
[11] -0.5695221195 -1.5222558918 -1.5847247558 -0.3281793580 -0.5236022398
[16] 0.3810630308 -0.6088597928 -0.7609707495 -0.1742372126 1.0828963611
[21] -1.3092999057 1.9859170835 0.3210780578 0.0059332372 -0.8712737561
[26] -0.9859875921 1.0442231125 -0.3706143380 -0.2623011550 1.1781254128
[31] 0.4610682990 0.9512898089 0.2888262615 -1.5448460113 -1.0852648757
[36] -0.7099966364 -0.9307104747 0.4274520827 -0.3059769265 0.3374067142
[41] 0.5303049013 0.4952092531 1.0573197647 1.0776350199 0.2471806163
[46] -1.0182888893 1.4357048285 1.8034430509 1.4836787314 -0.3137806993
[51] -0.5427259499 2.0252820638 -0.9066430941 -1.5281845268 0.2374493815
[56] 0.7051508259 -0.7073427891 0.1024457495 0.7405048686 -0.7931279956
[61] 0.5897716348 1.5723956590 0.1705890049 -0.4235075111 -0.3674295029
[66] 0.4597351009 -0.3343673387 -1.1188189920 0.9675934322 -0.6418628285
[71] 0.6465411775 -0.7991803153 0.8036642794 -0.9600256954 1.2709159675
[76] 1.6786636848 -0.7810679458 -0.8512471290 0.2636712145 -0.3729940811
[81] -0.6449831542 1.6591098641 0.1390586511 0.6590639078 0.1075035682
[86] 0.2645987676 0.4063338579 -0.4129985380 0.7883257007 0.1925451598
[91] -0.1468874209 -0.3944034365 1.2740715128 -0.2777384566 -1.2935874697
[96] 0.7921789395 -0.0005687176 -0.9736606526 1.3833121807 0.5347843234
>
> colMeans(tmp2)
[1] 0.1048317
> colSums(tmp2)
[1] 10.48317
> colVars(tmp2)
[1] 0.7949219
> colSd(tmp2)
[1] 0.8915839
> colMax(tmp2)
[1] 2.025282
> colMin(tmp2)
[1] -1.584725
> colMedians(tmp2)
[1] 0.1232811
> colRanges(tmp2)
[,1]
[1,] -1.584725
[2,] 2.025282
>
> 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] -2.613243 -2.547883 2.843088 -2.572317 -1.976240 9.493220 2.930503
[8] 2.024009 -1.070568 -4.427701
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.2444289
[2,] -0.8743173
[3,] -0.2548037
[4,] 0.1783836
[5,] 0.7909788
>
> rowApply(tmp,sum)
[1] -0.9167276 -2.5012049 2.7812680 4.3377695 0.7468124 -6.9685834
[7] 2.2789868 2.0861844 -1.9939888 2.2323520
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 6 1 3 3 8 6 5 7 2 1
[2,] 4 4 1 7 7 8 3 3 5 3
[3,] 5 9 8 4 4 10 9 8 4 2
[4,] 1 6 7 2 10 7 10 1 3 7
[5,] 9 3 4 6 2 3 1 5 9 6
[6,] 10 10 9 9 9 9 4 9 8 10
[7,] 3 8 10 8 1 1 8 6 7 9
[8,] 8 2 6 10 6 5 6 2 10 8
[9,] 7 7 5 5 3 4 2 10 1 5
[10,] 2 5 2 1 5 2 7 4 6 4
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -0.72092380 2.86243342 2.70076192 -0.04730527 1.64721853 -0.82088055
[7] 1.18619851 1.63663998 -0.03968275 1.11689519 -1.26089012 3.30746364
[13] 1.26031698 -0.85323173 -1.02492896 -1.70208033 -1.32825473 -3.52449378
[19] 1.06153566 0.92223073
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.3313901
[2,] -0.3221109
[3,] -0.2443368
[4,] 0.1858525
[5,] 0.9910615
>
> rowApply(tmp,sum)
[1] 3.7363892 -0.9589672 4.8235897 1.1584525 -2.3804417
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 9 16 5 13 2
[2,] 5 17 17 17 9
[3,] 17 20 11 2 19
[4,] 4 9 7 19 3
[5,] 18 5 12 10 20
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.2443368 -0.46673279 0.96049860 -0.49522638 1.623045130 -0.6406383
[2,] 0.9910615 1.21850032 2.02244616 0.02593599 -1.070665424 -0.2897323
[3,] -0.3221109 1.13214327 0.09367679 -0.24975795 0.134603514 -0.7263011
[4,] 0.1858525 1.05446594 -1.31834034 1.74187839 -0.001108098 0.2156795
[5,] -1.3313901 -0.07594332 0.94248071 -1.07013531 0.961343413 0.6201116
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.14022361 2.2824998 -0.36190932 0.59673442 0.8684835 -0.28269433
[2,] 0.02809090 0.2768253 0.10183391 0.03604112 -1.8683856 1.60252329
[3,] 1.94830638 1.1399035 -0.27768396 -0.10679492 -0.5002045 1.78798239
[4,] -0.57812770 -1.0456901 0.01492319 -0.09301266 0.5907019 0.05234904
[5,] -0.07184747 -1.0168986 0.48315342 0.68392723 -0.3514855 0.14730326
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.2611108 1.74723919 0.04536512 0.8276031 0.21336830 -0.83412576
[2,] -0.8910555 -1.23137871 0.39932464 -1.8950470 -0.62930302 -1.32457355
[3,] 0.3518612 -0.01689064 0.07142118 -0.4018745 -0.47753945 0.25338940
[4,] 1.5077275 -0.51686014 -0.13232348 0.2029105 -0.44726624 -1.56380643
[5,] 0.5528946 -0.83534143 -1.40871642 -0.4356725 0.01248567 -0.05537745
[,19] [,20]
[1,] 0.5797048 -2.2811547
[2,] 1.2544148 0.2841759
[3,] 0.1421533 0.8473067
[4,] -0.6671455 1.9556448
[5,] -0.2475917 0.1162581
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 654 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 0.1735206 -0.2161911 -0.7745597 -1.095479 -1.454676 0.8417689 0.7845852
col8 col9 col10 col11 col12 col13 col14
row1 -0.6124712 -0.1802379 -0.1276196 0.7620305 -0.2758716 -0.1922352 1.011013
col15 col16 col17 col18 col19 col20
row1 2.672403 -1.05018 0.2147419 -1.685513 -0.9102611 -1.789743
> tmp[,"col10"]
col10
row1 -0.1276196
row2 -1.0730636
row3 0.4640172
row4 1.2004051
row5 -0.3332679
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 0.1735206 -0.2161911 -0.7745597 -1.095479 -1.4546760 0.8417689 0.7845852
row5 -0.8040923 0.5888883 0.7945549 0.765715 0.1360824 0.5466099 -0.9143140
col8 col9 col10 col11 col12 col13
row1 -0.6124712 -0.18023790 -0.1276196 0.7620305 -0.2758716 -0.1922352
row5 -0.5041039 -0.06854227 -0.3332679 1.3014184 0.5474387 1.6542812
col14 col15 col16 col17 col18 col19 col20
row1 1.01101261 2.6724026 -1.05018 0.2147419 -1.685513 -0.91026113 -1.789743
row5 0.02333696 -0.3251708 -0.48578 1.3555492 2.356872 -0.07207322 1.371112
> tmp[,c("col6","col20")]
col6 col20
row1 0.84176892 -1.7897430
row2 0.04350745 -1.2132906
row3 -1.00136607 0.2413201
row4 -2.12946500 1.2434722
row5 0.54660994 1.3711120
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.8417689 -1.789743
row5 0.5466099 1.371112
>
>
>
>
> 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.96231 50.61937 48.81417 49.3041 50.8214 105.6799 50.58669 50.13239
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.41914 50.80026 48.99768 49.72125 48.40819 51.26772 50.48725 50.22437
col17 col18 col19 col20
row1 51.58439 50.67395 48.63025 107.0982
> tmp[,"col10"]
col10
row1 50.80026
row2 28.64462
row3 29.86845
row4 30.88048
row5 50.01843
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.96231 50.61937 48.81417 49.30410 50.82140 105.6799 50.58669 50.13239
row5 50.60306 49.90382 51.36088 49.67002 50.81721 105.6374 49.69766 49.95059
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.41914 50.80026 48.99768 49.72125 48.40819 51.26772 50.48725 50.22437
row5 50.65100 50.01843 48.20905 50.00960 49.71663 48.93774 48.62240 50.71666
col17 col18 col19 col20
row1 51.58439 50.67395 48.63025 107.0982
row5 50.49774 51.75521 51.28969 105.7507
> tmp[,c("col6","col20")]
col6 col20
row1 105.67991 107.09815
row2 75.62831 76.01326
row3 75.51761 74.92398
row4 75.86158 75.19901
row5 105.63735 105.75074
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.6799 107.0982
row5 105.6374 105.7507
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.6799 107.0982
row5 105.6374 105.7507
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.1545735
[2,] -1.7923866
[3,] -0.1465615
[4,] 0.4432162
[5,] 0.1843661
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.5878825 1.17966834
[2,] 1.6831098 -2.58242370
[3,] 0.4380353 -0.82184377
[4,] -1.2153309 0.08278238
[5,] 0.3758350 -0.52379572
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 1.4640151 0.5750350
[2,] -0.4475855 1.5689192
[3,] -0.8857409 -2.2547510
[4,] 0.1475675 0.4651068
[5,] -1.0127342 -2.0342099
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 1.464015
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 1.4640151
[2,] -0.4475855
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row3 1.671080 0.6000764 -1.2608217 0.9237189 -1.0109000 1.0823347 -0.02477107
row1 -2.427337 0.7229507 0.2805602 0.6167897 0.6914074 -0.4898628 -0.94514905
[,8] [,9] [,10] [,11] [,12] [,13]
row3 0.8266191 1.1924165 -1.022648 0.1175154 0.2639288 -0.4880646
row1 -0.1442321 -0.5113385 0.720885 -0.1379113 -0.3147411 -0.5590653
[,14] [,15] [,16] [,17] [,18] [,19]
row3 0.005516401 0.3920157 -0.3047329 0.2863283 0.864696932 0.2080843
row1 -0.583333832 -1.5732941 -2.4688241 -2.4640183 -0.007350393 -0.3900799
[,20]
row3 1.587092
row1 -1.379237
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -2.650831 0.1879443 -1.228712 -0.8347992 0.08785485 -0.8465309 0.03051387
[,8] [,9] [,10]
row2 0.3778488 -0.4115999 -0.6898791
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 2.270773 -0.8650945 0.03074014 -0.6370066 -0.1595131 -0.06950304 -2.393926
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.7554756 -0.5967725 -0.6791444 1.168519 -1.070885 -1.935717 0.6915128
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.3356802 -0.3799153 -0.150372 -0.4856152 -0.2985554 0.8949877
>
>
> 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: 0x5f14217e8050>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM27400a583f91dc"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM27400a50835861"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM27400a60560108"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM27400a5a7a67b5"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM27400a607acdd1"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM27400a6d665707"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM27400af257c81"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM27400a46edbf93"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM27400ac7e6d5e"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM27400a23fd2e01"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM27400a5188cc6"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM27400a351c007d"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM27400a2dd962cb"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM27400a5b573eb8"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM27400a1ecab1f7"
>
>
> ### 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: 0x5f1421443ef0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5f1421443ef0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5f1421443ef0>
> rowMedians(tmp)
[1] -0.244509606 0.041381817 0.123977279 0.218791927 0.300549461
[6] -0.606364241 0.150496162 -0.597107564 0.147994261 -0.183187468
[11] -0.665836120 -0.191160106 -0.210846056 -0.603108131 -0.455491106
[16] 0.458559492 -0.361723468 -0.388130795 -0.679224084 -0.095085111
[21] -0.006586849 0.176390759 0.123287954 0.306835309 0.158204969
[26] 0.266551427 0.193644255 0.524819351 0.381065287 0.551237851
[31] -0.276426954 -0.345666804 -0.200959001 -0.107125112 0.445892184
[36] -0.209337681 0.427104479 -0.422899615 0.304902127 -0.119353058
[41] -0.595333604 -0.394211984 -0.743178356 0.154973989 -0.120557601
[46] 0.398066043 -0.765801514 -0.220460349 0.034786240 -0.436307502
[51] -0.199576379 -0.003957358 -0.122015819 0.254710350 0.043812769
[56] -0.187718467 0.004669112 0.001225114 0.543857068 0.122685841
[61] -0.312445340 -0.257856108 0.408367349 0.114352593 0.160626201
[66] -0.031401955 0.040959563 0.324288171 0.204741543 0.069227285
[71] 0.125381328 -0.088268566 -0.306703173 0.049220577 -0.692767614
[76] -0.589274689 -0.014131552 0.098218544 0.696874836 0.150434178
[81] -0.051109192 -0.280755872 -0.322846202 -0.439864627 -0.264931257
[86] 0.177521753 -0.261583233 0.417812813 0.247621693 0.037436866
[91] -0.019111983 -0.195020463 0.554192755 -0.115755934 -0.063519990
[96] 0.277080008 0.573867001 -0.359150574 0.199578976 0.100590370
[101] -0.231155464 0.133487919 0.134133435 0.054330231 -0.385456238
[106] -0.304980681 0.466237848 0.211034331 -1.085454615 -0.201260014
[111] -0.287027826 0.165735126 -0.474802667 -0.249404677 0.028529099
[116] 0.074641624 -0.122166139 0.674818943 -0.002907794 0.721487744
[121] 0.103028277 -0.144187732 -0.266572053 -0.127902940 0.154198741
[126] -0.219058131 -0.381013957 0.459144132 -0.212560074 -0.012845628
[131] 0.591372792 0.082788457 -0.044413066 0.429039401 -0.389156854
[136] 0.016544392 -0.092430639 -0.376443570 1.201216774 -0.383531948
[141] -0.192122672 0.158827594 0.395864099 -0.125658260 -0.099437874
[146] 0.342999535 0.450719802 -0.151422688 -0.046435513 0.255523247
[151] -0.229510063 0.417738860 0.114240122 -0.015767716 0.255108803
[156] -0.180718887 -0.271467550 -0.221720149 -0.507993329 -0.673051885
[161] -0.033821854 0.397947624 -0.219224432 -0.259367348 -0.077163231
[166] 0.175365191 -0.091979305 -0.021285010 -0.045477561 0.372954715
[171] 0.093039027 -0.413358283 0.158756512 -0.596925412 -0.258275128
[176] 0.432990651 -0.255775313 -0.054174627 -0.019787304 -0.032962126
[181] -0.043699448 0.836832066 0.083628341 -0.327307036 0.144562437
[186] 0.018134274 -0.098570580 -0.623024917 0.239724914 -0.158836450
[191] -0.374214930 0.381475899 0.287496880 0.903197037 0.410920832
[196] -0.210497420 -0.435193628 0.526625998 -0.084985584 -0.365501782
[201] 0.103019942 -0.103877532 0.020454691 0.130559100 0.370549208
[206] -0.083397661 -0.008430579 -0.548238439 -0.199600032 -0.416934511
[211] -0.007542482 -0.192634696 -0.109860386 -0.238721465 0.398409576
[216] -0.274110412 -0.257010710 0.249363895 -0.208857943 -0.265238937
[221] -0.121474112 -0.310489072 0.146433444 0.355072153 0.748113975
[226] 0.139048395 0.135728928 -0.100594753 -0.431670979 0.459569215
>
> proc.time()
user system elapsed
1.403 1.478 2.871
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: 0x5cbe83e2ac10>
> .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: 0x5cbe83e2ac10>
> .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: 0x5cbe83e2ac10>
> .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: 0x5cbe83e2ac10>
> 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: 0x5cbe84aed2d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5cbe84aed2d0>
> .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: 0x5cbe84aed2d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5cbe84aed2d0>
> .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: 0x5cbe84aed2d0>
> 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: 0x5cbe851c2d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5cbe851c2d70>
> .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: 0x5cbe851c2d70>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5cbe851c2d70>
> .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: 0x5cbe851c2d70>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5cbe851c2d70>
> .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: 0x5cbe851c2d70>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5cbe851c2d70>
> .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: 0x5cbe851c2d70>
> 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: 0x5cbe84d36370>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5cbe84d36370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5cbe84d36370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5cbe84d36370>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile27413a20ec723a" "BufferedMatrixFile27413a3bed5159"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile27413a20ec723a" "BufferedMatrixFile27413a3bed5159"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5cbe84c81ff0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5cbe84c81ff0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5cbe84c81ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5cbe84c81ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5cbe84c81ff0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5cbe84c81ff0>
> .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: 0x5cbe84e643d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5cbe84e643d0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5cbe84e643d0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5cbe84e643d0>
> 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: 0x5cbe86615fb0>
> .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: 0x5cbe86615fb0>
> rm(P)
>
> proc.time()
user system elapsed
0.262 0.049 0.300
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100 0
> buffer.dim(Temp)
[1] 1 1
>
>
> proc.time()
user system elapsed
0.248 0.040 0.278