| Back to Build/check report for BioC 3.24: simplified long |
|
This page was generated on 2026-05-15 11:33 -0400 (Fri, 15 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" | 4894 |
| 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/2375 | 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-14 21:55:22 -0400 (Thu, 14 May 2026) |
| EndedAt: 2026-05-14 21:55:46 -0400 (Thu, 14 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-15 01:55:23 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.248 0.045 0.280
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] "Thu May 14 21:55:38 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] "Thu May 14 21:55:38 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: 0x5e3a1e933520>
>
>
>
> 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] "Thu May 14 21:55:38 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] "Thu May 14 21:55:38 2026"
>
> ColMode(tmp2)
<pointer: 0x5e3a1e933520>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.264424697 -2.2171957 -0.2295891 1.2381731
[2,] -0.725677710 0.1183776 0.4260316 0.1832200
[3,] 0.008622288 -0.6250025 2.1896496 -0.3607209
[4,] -1.542496005 -0.9258211 0.9721021 -0.5266150
> 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,] 1.002644e+02 2.2171957 0.2295891 1.2381731
[2,] 7.256777e-01 0.1183776 0.4260316 0.1832200
[3,] 8.622288e-03 0.6250025 2.1896496 0.3607209
[4,] 1.542496e+00 0.9258211 0.9721021 0.5266150
> 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,] 10.01321251 1.4890251 0.4791545 1.1127323
[2,] 0.85186719 0.3440604 0.6527110 0.4280421
[3,] 0.09285627 0.7905710 1.4797465 0.6006005
[4,] 1.24197263 0.9621960 0.9859524 0.7256824
>
> 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,] 225.39655 42.10745 30.02113 37.36550
[2,] 34.24435 28.55898 31.95314 29.46364
[3,] 25.93719 33.53071 41.98711 31.36673
[4,] 38.96222 35.54778 35.83163 32.78344
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5e3a1f71e8f0>
> exp(tmp5)
<pointer: 0x5e3a1f71e8f0>
> log(tmp5,2)
<pointer: 0x5e3a1f71e8f0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.1334
> Min(tmp5)
[1] 53.55334
> mean(tmp5)
[1] 71.79341
> Sum(tmp5)
[1] 14358.68
> Var(tmp5)
[1] 866.9908
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.60377 67.51318 68.40480 72.97319 69.04689 68.36647 70.05439 68.64244
[9] 71.04812 70.28082
> rowSums(tmp5)
[1] 1832.075 1350.264 1368.096 1459.464 1380.938 1367.329 1401.088 1372.849
[9] 1420.962 1405.616
> rowVars(tmp5)
[1] 7975.90509 61.93475 88.18845 78.03438 73.82241 74.93089
[7] 60.43303 69.84529 44.39094 70.23028
> rowSd(tmp5)
[1] 89.307923 7.869863 9.390870 8.833707 8.591997 8.656263 7.773868
[8] 8.357349 6.662653 8.380351
> rowMax(tmp5)
[1] 469.13339 81.40750 87.39068 83.27854 87.10901 84.60728 83.22348
[8] 85.76106 81.58712 89.98824
> rowMin(tmp5)
[1] 55.87677 54.99042 53.64873 54.39652 53.55334 53.67437 58.72921 56.21666
[9] 58.38469 56.42152
>
> colMeans(tmp5)
[1] 108.25729 69.94524 68.98111 71.42495 70.55312 70.40400 66.14237
[8] 70.77936 72.36750 73.51915 68.70821 72.42084 68.28941 65.44298
[15] 72.90200 69.29397 69.06038 66.74959 72.25240 68.37426
> colSums(tmp5)
[1] 1082.5729 699.4524 689.8111 714.2495 705.5312 704.0400 661.4237
[8] 707.7936 723.6750 735.1915 687.0821 724.2084 682.8941 654.4298
[15] 729.0200 692.9397 690.6038 667.4959 722.5240 683.7426
> colVars(tmp5)
[1] 16151.64789 89.47316 66.55666 55.29258 60.68668 99.36063
[7] 37.93805 64.49544 42.32399 45.35524 47.57394 114.27110
[13] 82.53858 54.52979 92.70984 68.85763 42.59152 77.77229
[19] 100.02722 114.32802
> colSd(tmp5)
[1] 127.089134 9.459025 8.158226 7.435898 7.790166 9.967980
[7] 6.159387 8.030905 6.505689 6.734630 6.897387 10.689766
[13] 9.085074 7.384429 9.628595 8.298050 6.526218 8.818860
[19] 10.001361 10.692428
> colMax(tmp5)
[1] 469.13339 87.64113 87.39068 79.59557 83.27854 85.69594 77.82791
[8] 84.08978 83.51035 83.22348 77.55615 87.10901 80.72157 75.58598
[15] 84.84435 79.63737 80.20390 85.76106 89.98824 82.38133
> colMin(tmp5)
[1] 53.98485 58.92728 58.26983 60.13981 60.50639 53.64873 57.26161 56.42152
[9] 62.64572 65.86192 53.67437 58.15133 53.86926 53.55334 55.95743 56.21666
[17] 56.87299 56.12965 62.41523 54.39652
>
>
> ### 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] NA 67.51318 68.40480 72.97319 69.04689 68.36647 70.05439 68.64244
[9] 71.04812 70.28082
> rowSums(tmp5)
[1] NA 1350.264 1368.096 1459.464 1380.938 1367.329 1401.088 1372.849
[9] 1420.962 1405.616
> rowVars(tmp5)
[1] 8402.68364 61.93475 88.18845 78.03438 73.82241 74.93089
[7] 60.43303 69.84529 44.39094 70.23028
> rowSd(tmp5)
[1] 91.666153 7.869863 9.390870 8.833707 8.591997 8.656263 7.773868
[8] 8.357349 6.662653 8.380351
> rowMax(tmp5)
[1] NA 81.40750 87.39068 83.27854 87.10901 84.60728 83.22348 85.76106
[9] 81.58712 89.98824
> rowMin(tmp5)
[1] NA 54.99042 53.64873 54.39652 53.55334 53.67437 58.72921 56.21666
[9] 58.38469 56.42152
>
> colMeans(tmp5)
[1] 108.25729 69.94524 68.98111 71.42495 70.55312 70.40400 66.14237
[8] 70.77936 72.36750 73.51915 68.70821 72.42084 NA 65.44298
[15] 72.90200 69.29397 69.06038 66.74959 72.25240 68.37426
> colSums(tmp5)
[1] 1082.5729 699.4524 689.8111 714.2495 705.5312 704.0400 661.4237
[8] 707.7936 723.6750 735.1915 687.0821 724.2084 NA 654.4298
[15] 729.0200 692.9397 690.6038 667.4959 722.5240 683.7426
> colVars(tmp5)
[1] 16151.64789 89.47316 66.55666 55.29258 60.68668 99.36063
[7] 37.93805 64.49544 42.32399 45.35524 47.57394 114.27110
[13] NA 54.52979 92.70984 68.85763 42.59152 77.77229
[19] 100.02722 114.32802
> colSd(tmp5)
[1] 127.089134 9.459025 8.158226 7.435898 7.790166 9.967980
[7] 6.159387 8.030905 6.505689 6.734630 6.897387 10.689766
[13] NA 7.384429 9.628595 8.298050 6.526218 8.818860
[19] 10.001361 10.692428
> colMax(tmp5)
[1] 469.13339 87.64113 87.39068 79.59557 83.27854 85.69594 77.82791
[8] 84.08978 83.51035 83.22348 77.55615 87.10901 NA 75.58598
[15] 84.84435 79.63737 80.20390 85.76106 89.98824 82.38133
> colMin(tmp5)
[1] 53.98485 58.92728 58.26983 60.13981 60.50639 53.64873 57.26161 56.42152
[9] 62.64572 65.86192 53.67437 58.15133 NA 53.55334 55.95743 56.21666
[17] 56.87299 56.12965 62.41523 54.39652
>
> Max(tmp5,na.rm=TRUE)
[1] 469.1334
> Min(tmp5,na.rm=TRUE)
[1] 53.55334
> mean(tmp5,na.rm=TRUE)
[1] 71.77782
> Sum(tmp5,na.rm=TRUE)
[1] 14283.79
> Var(tmp5,na.rm=TRUE)
[1] 871.3207
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 92.48320 67.51318 68.40480 72.97319 69.04689 68.36647 70.05439 68.64244
[9] 71.04812 70.28082
> rowSums(tmp5,na.rm=TRUE)
[1] 1757.181 1350.264 1368.096 1459.464 1380.938 1367.329 1401.088 1372.849
[9] 1420.962 1405.616
> rowVars(tmp5,na.rm=TRUE)
[1] 8402.68364 61.93475 88.18845 78.03438 73.82241 74.93089
[7] 60.43303 69.84529 44.39094 70.23028
> rowSd(tmp5,na.rm=TRUE)
[1] 91.666153 7.869863 9.390870 8.833707 8.591997 8.656263 7.773868
[8] 8.357349 6.662653 8.380351
> rowMax(tmp5,na.rm=TRUE)
[1] 469.13339 81.40750 87.39068 83.27854 87.10901 84.60728 83.22348
[8] 85.76106 81.58712 89.98824
> rowMin(tmp5,na.rm=TRUE)
[1] 55.87677 54.99042 53.64873 54.39652 53.55334 53.67437 58.72921 56.21666
[9] 58.38469 56.42152
>
> colMeans(tmp5,na.rm=TRUE)
[1] 108.25729 69.94524 68.98111 71.42495 70.55312 70.40400 66.14237
[8] 70.77936 72.36750 73.51915 68.70821 72.42084 67.55550 65.44298
[15] 72.90200 69.29397 69.06038 66.74959 72.25240 68.37426
> colSums(tmp5,na.rm=TRUE)
[1] 1082.5729 699.4524 689.8111 714.2495 705.5312 704.0400 661.4237
[8] 707.7936 723.6750 735.1915 687.0821 724.2084 607.9995 654.4298
[15] 729.0200 692.9397 690.6038 667.4959 722.5240 683.7426
> colVars(tmp5,na.rm=TRUE)
[1] 16151.64789 89.47316 66.55666 55.29258 60.68668 99.36063
[7] 37.93805 64.49544 42.32399 45.35524 47.57394 114.27110
[13] 86.79640 54.52979 92.70984 68.85763 42.59152 77.77229
[19] 100.02722 114.32802
> colSd(tmp5,na.rm=TRUE)
[1] 127.089134 9.459025 8.158226 7.435898 7.790166 9.967980
[7] 6.159387 8.030905 6.505689 6.734630 6.897387 10.689766
[13] 9.316459 7.384429 9.628595 8.298050 6.526218 8.818860
[19] 10.001361 10.692428
> colMax(tmp5,na.rm=TRUE)
[1] 469.13339 87.64113 87.39068 79.59557 83.27854 85.69594 77.82791
[8] 84.08978 83.51035 83.22348 77.55615 87.10901 80.72157 75.58598
[15] 84.84435 79.63737 80.20390 85.76106 89.98824 82.38133
> colMin(tmp5,na.rm=TRUE)
[1] 53.98485 58.92728 58.26983 60.13981 60.50639 53.64873 57.26161 56.42152
[9] 62.64572 65.86192 53.67437 58.15133 53.86926 53.55334 55.95743 56.21666
[17] 56.87299 56.12965 62.41523 54.39652
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] NaN 67.51318 68.40480 72.97319 69.04689 68.36647 70.05439 68.64244
[9] 71.04812 70.28082
> rowSums(tmp5,na.rm=TRUE)
[1] 0.000 1350.264 1368.096 1459.464 1380.938 1367.329 1401.088 1372.849
[9] 1420.962 1405.616
> rowVars(tmp5,na.rm=TRUE)
[1] NA 61.93475 88.18845 78.03438 73.82241 74.93089 60.43303 69.84529
[9] 44.39094 70.23028
> rowSd(tmp5,na.rm=TRUE)
[1] NA 7.869863 9.390870 8.833707 8.591997 8.656263 7.773868 8.357349
[9] 6.662653 8.380351
> rowMax(tmp5,na.rm=TRUE)
[1] NA 81.40750 87.39068 83.27854 87.10901 84.60728 83.22348 85.76106
[9] 81.58712 89.98824
> rowMin(tmp5,na.rm=TRUE)
[1] NA 54.99042 53.64873 54.39652 53.55334 53.67437 58.72921 56.21666
[9] 58.38469 56.42152
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 68.15995 67.97903 69.70290 70.71980 70.02205 70.30860 64.84398 69.30042
[9] 71.74729 73.84594 68.83487 73.90233 NaN 66.50590 71.57508 69.89696
[17] 69.13459 67.51113 72.96265 67.33619
> colSums(tmp5,na.rm=TRUE)
[1] 613.4395 611.8113 627.3261 636.4782 630.1985 632.7774 583.5958 623.7038
[9] 645.7257 664.6135 619.5138 665.1209 0.0000 598.5531 644.1757 629.0727
[17] 622.2113 607.6002 656.6638 606.0257
> colVars(tmp5,na.rm=TRUE)
[1] 82.88770 57.16499 69.01531 56.61011 65.09971 111.67831 23.71478
[8] 47.95077 43.28706 49.82321 53.34021 103.86360 NA 48.63595
[15] 84.49030 73.37439 47.85351 80.96946 106.85558 116.49608
> colSd(tmp5,na.rm=TRUE)
[1] 9.104268 7.560754 8.307545 7.523969 8.068439 10.567796 4.869782
[8] 6.924649 6.579290 7.058556 7.303438 10.191349 NA 6.973948
[15] 9.191860 8.565885 6.917623 8.998303 10.337097 10.793335
> colMax(tmp5,na.rm=TRUE)
[1] 81.09476 81.58712 87.39068 79.59557 83.27854 85.69594 72.91271 81.40750
[9] 83.51035 83.22348 77.55615 87.10901 -Inf 75.58598 84.60728 79.63737
[17] 80.20390 85.76106 89.98824 82.38133
> colMin(tmp5,na.rm=TRUE)
[1] 53.98485 58.92728 58.26983 60.13981 60.50639 53.64873 57.26161 56.42152
[9] 62.64572 65.86192 53.67437 58.15133 Inf 53.55334 55.95743 56.21666
[17] 56.87299 56.12965 62.41523 54.39652
>
>
>
>
> 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] 230.7432 190.8809 392.1478 199.5586 235.3828 310.3709 423.2322 106.3657
[9] 179.4325 253.0438
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 230.7432 190.8809 392.1478 199.5586 235.3828 310.3709 423.2322 106.3657
[9] 179.4325 253.0438
>
>
>
> 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] 2.842171e-14 -1.136868e-13 7.105427e-14 -5.684342e-14 2.842171e-14
[6] 1.705303e-13 8.526513e-14 5.684342e-14 0.000000e+00 5.684342e-14
[11] -5.684342e-14 5.684342e-14 1.421085e-14 -1.136868e-13 -5.684342e-14
[16] 1.705303e-13 1.136868e-13 2.842171e-14 -8.526513e-14 8.526513e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
5 3
7 15
7 3
10 9
6 5
9 20
2 15
4 6
6 16
9 1
4 14
7 20
8 9
4 17
8 8
3 18
4 14
1 6
10 16
10 6
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.680321
> Min(tmp)
[1] -2.363945
> mean(tmp)
[1] 0.03577722
> Sum(tmp)
[1] 3.577722
> Var(tmp)
[1] 0.8119854
>
> rowMeans(tmp)
[1] 0.03577722
> rowSums(tmp)
[1] 3.577722
> rowVars(tmp)
[1] 0.8119854
> rowSd(tmp)
[1] 0.9011023
> rowMax(tmp)
[1] 1.680321
> rowMin(tmp)
[1] -2.363945
>
> colMeans(tmp)
[1] -0.80252014 -1.00570338 -0.96310212 0.31796527 -0.46976232 0.42615151
[7] 1.68032073 -2.36394480 0.41145524 -0.29697185 -1.45146908 -0.33587300
[13] -1.28226051 -1.79948507 -0.04706619 -0.20034175 0.70559675 0.59806830
[19] -0.43800215 1.62120363 0.43979541 0.72352389 0.33941220 0.28070691
[25] 0.39810983 0.79492165 0.18889446 -0.55473785 0.43271067 -0.05439074
[31] 0.27420734 -0.40199296 0.18949902 -1.15409914 1.55415572 -1.69488614
[37] 0.04576297 -0.45583030 0.95385992 0.58143069 1.16604121 1.13513233
[43] 0.74121662 -0.41631658 -0.49156161 -0.82326958 -0.29781852 -1.37004060
[49] -1.58189128 -1.07165884 0.68218200 -0.29492353 0.21292250 0.92633578
[55] -0.24476083 -2.03901738 1.22983468 0.15220289 0.33670282 -0.22969549
[61] 1.31194616 0.43942408 -0.24518511 -1.90553761 0.14783372 1.22756755
[67] -0.12037241 1.31110124 -0.54502047 0.32158289 -0.85248849 0.50780043
[73] -1.45958680 0.95339918 -0.23215928 0.30528463 0.81591931 0.97471177
[79] 0.38752708 0.63951221 0.96788798 -0.11865395 -0.03780435 -0.66730249
[85] -0.61093742 0.83840908 -1.06860497 -0.58942087 0.79839630 1.04410659
[91] 1.26570497 0.59904495 0.93004636 -1.60780205 -0.33507252 0.23140986
[97] 0.14716472 0.59728415 0.87060005 1.43307675
> colSums(tmp)
[1] -0.80252014 -1.00570338 -0.96310212 0.31796527 -0.46976232 0.42615151
[7] 1.68032073 -2.36394480 0.41145524 -0.29697185 -1.45146908 -0.33587300
[13] -1.28226051 -1.79948507 -0.04706619 -0.20034175 0.70559675 0.59806830
[19] -0.43800215 1.62120363 0.43979541 0.72352389 0.33941220 0.28070691
[25] 0.39810983 0.79492165 0.18889446 -0.55473785 0.43271067 -0.05439074
[31] 0.27420734 -0.40199296 0.18949902 -1.15409914 1.55415572 -1.69488614
[37] 0.04576297 -0.45583030 0.95385992 0.58143069 1.16604121 1.13513233
[43] 0.74121662 -0.41631658 -0.49156161 -0.82326958 -0.29781852 -1.37004060
[49] -1.58189128 -1.07165884 0.68218200 -0.29492353 0.21292250 0.92633578
[55] -0.24476083 -2.03901738 1.22983468 0.15220289 0.33670282 -0.22969549
[61] 1.31194616 0.43942408 -0.24518511 -1.90553761 0.14783372 1.22756755
[67] -0.12037241 1.31110124 -0.54502047 0.32158289 -0.85248849 0.50780043
[73] -1.45958680 0.95339918 -0.23215928 0.30528463 0.81591931 0.97471177
[79] 0.38752708 0.63951221 0.96788798 -0.11865395 -0.03780435 -0.66730249
[85] -0.61093742 0.83840908 -1.06860497 -0.58942087 0.79839630 1.04410659
[91] 1.26570497 0.59904495 0.93004636 -1.60780205 -0.33507252 0.23140986
[97] 0.14716472 0.59728415 0.87060005 1.43307675
> 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.80252014 -1.00570338 -0.96310212 0.31796527 -0.46976232 0.42615151
[7] 1.68032073 -2.36394480 0.41145524 -0.29697185 -1.45146908 -0.33587300
[13] -1.28226051 -1.79948507 -0.04706619 -0.20034175 0.70559675 0.59806830
[19] -0.43800215 1.62120363 0.43979541 0.72352389 0.33941220 0.28070691
[25] 0.39810983 0.79492165 0.18889446 -0.55473785 0.43271067 -0.05439074
[31] 0.27420734 -0.40199296 0.18949902 -1.15409914 1.55415572 -1.69488614
[37] 0.04576297 -0.45583030 0.95385992 0.58143069 1.16604121 1.13513233
[43] 0.74121662 -0.41631658 -0.49156161 -0.82326958 -0.29781852 -1.37004060
[49] -1.58189128 -1.07165884 0.68218200 -0.29492353 0.21292250 0.92633578
[55] -0.24476083 -2.03901738 1.22983468 0.15220289 0.33670282 -0.22969549
[61] 1.31194616 0.43942408 -0.24518511 -1.90553761 0.14783372 1.22756755
[67] -0.12037241 1.31110124 -0.54502047 0.32158289 -0.85248849 0.50780043
[73] -1.45958680 0.95339918 -0.23215928 0.30528463 0.81591931 0.97471177
[79] 0.38752708 0.63951221 0.96788798 -0.11865395 -0.03780435 -0.66730249
[85] -0.61093742 0.83840908 -1.06860497 -0.58942087 0.79839630 1.04410659
[91] 1.26570497 0.59904495 0.93004636 -1.60780205 -0.33507252 0.23140986
[97] 0.14716472 0.59728415 0.87060005 1.43307675
> colMin(tmp)
[1] -0.80252014 -1.00570338 -0.96310212 0.31796527 -0.46976232 0.42615151
[7] 1.68032073 -2.36394480 0.41145524 -0.29697185 -1.45146908 -0.33587300
[13] -1.28226051 -1.79948507 -0.04706619 -0.20034175 0.70559675 0.59806830
[19] -0.43800215 1.62120363 0.43979541 0.72352389 0.33941220 0.28070691
[25] 0.39810983 0.79492165 0.18889446 -0.55473785 0.43271067 -0.05439074
[31] 0.27420734 -0.40199296 0.18949902 -1.15409914 1.55415572 -1.69488614
[37] 0.04576297 -0.45583030 0.95385992 0.58143069 1.16604121 1.13513233
[43] 0.74121662 -0.41631658 -0.49156161 -0.82326958 -0.29781852 -1.37004060
[49] -1.58189128 -1.07165884 0.68218200 -0.29492353 0.21292250 0.92633578
[55] -0.24476083 -2.03901738 1.22983468 0.15220289 0.33670282 -0.22969549
[61] 1.31194616 0.43942408 -0.24518511 -1.90553761 0.14783372 1.22756755
[67] -0.12037241 1.31110124 -0.54502047 0.32158289 -0.85248849 0.50780043
[73] -1.45958680 0.95339918 -0.23215928 0.30528463 0.81591931 0.97471177
[79] 0.38752708 0.63951221 0.96788798 -0.11865395 -0.03780435 -0.66730249
[85] -0.61093742 0.83840908 -1.06860497 -0.58942087 0.79839630 1.04410659
[91] 1.26570497 0.59904495 0.93004636 -1.60780205 -0.33507252 0.23140986
[97] 0.14716472 0.59728415 0.87060005 1.43307675
> colMedians(tmp)
[1] -0.80252014 -1.00570338 -0.96310212 0.31796527 -0.46976232 0.42615151
[7] 1.68032073 -2.36394480 0.41145524 -0.29697185 -1.45146908 -0.33587300
[13] -1.28226051 -1.79948507 -0.04706619 -0.20034175 0.70559675 0.59806830
[19] -0.43800215 1.62120363 0.43979541 0.72352389 0.33941220 0.28070691
[25] 0.39810983 0.79492165 0.18889446 -0.55473785 0.43271067 -0.05439074
[31] 0.27420734 -0.40199296 0.18949902 -1.15409914 1.55415572 -1.69488614
[37] 0.04576297 -0.45583030 0.95385992 0.58143069 1.16604121 1.13513233
[43] 0.74121662 -0.41631658 -0.49156161 -0.82326958 -0.29781852 -1.37004060
[49] -1.58189128 -1.07165884 0.68218200 -0.29492353 0.21292250 0.92633578
[55] -0.24476083 -2.03901738 1.22983468 0.15220289 0.33670282 -0.22969549
[61] 1.31194616 0.43942408 -0.24518511 -1.90553761 0.14783372 1.22756755
[67] -0.12037241 1.31110124 -0.54502047 0.32158289 -0.85248849 0.50780043
[73] -1.45958680 0.95339918 -0.23215928 0.30528463 0.81591931 0.97471177
[79] 0.38752708 0.63951221 0.96788798 -0.11865395 -0.03780435 -0.66730249
[85] -0.61093742 0.83840908 -1.06860497 -0.58942087 0.79839630 1.04410659
[91] 1.26570497 0.59904495 0.93004636 -1.60780205 -0.33507252 0.23140986
[97] 0.14716472 0.59728415 0.87060005 1.43307675
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.8025201 -1.005703 -0.9631021 0.3179653 -0.4697623 0.4261515 1.680321
[2,] -0.8025201 -1.005703 -0.9631021 0.3179653 -0.4697623 0.4261515 1.680321
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -2.363945 0.4114552 -0.2969718 -1.451469 -0.335873 -1.282261 -1.799485
[2,] -2.363945 0.4114552 -0.2969718 -1.451469 -0.335873 -1.282261 -1.799485
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.04706619 -0.2003418 0.7055967 0.5980683 -0.4380022 1.621204 0.4397954
[2,] -0.04706619 -0.2003418 0.7055967 0.5980683 -0.4380022 1.621204 0.4397954
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.7235239 0.3394122 0.2807069 0.3981098 0.7949217 0.1888945 -0.5547378
[2,] 0.7235239 0.3394122 0.2807069 0.3981098 0.7949217 0.1888945 -0.5547378
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.4327107 -0.05439074 0.2742073 -0.401993 0.189499 -1.154099 1.554156
[2,] 0.4327107 -0.05439074 0.2742073 -0.401993 0.189499 -1.154099 1.554156
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -1.694886 0.04576297 -0.4558303 0.9538599 0.5814307 1.166041 1.135132
[2,] -1.694886 0.04576297 -0.4558303 0.9538599 0.5814307 1.166041 1.135132
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.7412166 -0.4163166 -0.4915616 -0.8232696 -0.2978185 -1.370041 -1.581891
[2,] 0.7412166 -0.4163166 -0.4915616 -0.8232696 -0.2978185 -1.370041 -1.581891
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -1.071659 0.682182 -0.2949235 0.2129225 0.9263358 -0.2447608 -2.039017
[2,] -1.071659 0.682182 -0.2949235 0.2129225 0.9263358 -0.2447608 -2.039017
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 1.229835 0.1522029 0.3367028 -0.2296955 1.311946 0.4394241 -0.2451851
[2,] 1.229835 0.1522029 0.3367028 -0.2296955 1.311946 0.4394241 -0.2451851
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -1.905538 0.1478337 1.227568 -0.1203724 1.311101 -0.5450205 0.3215829
[2,] -1.905538 0.1478337 1.227568 -0.1203724 1.311101 -0.5450205 0.3215829
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.8524885 0.5078004 -1.459587 0.9533992 -0.2321593 0.3052846 0.8159193
[2,] -0.8524885 0.5078004 -1.459587 0.9533992 -0.2321593 0.3052846 0.8159193
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.9747118 0.3875271 0.6395122 0.967888 -0.118654 -0.03780435 -0.6673025
[2,] 0.9747118 0.3875271 0.6395122 0.967888 -0.118654 -0.03780435 -0.6673025
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.6109374 0.8384091 -1.068605 -0.5894209 0.7983963 1.044107 1.265705
[2,] -0.6109374 0.8384091 -1.068605 -0.5894209 0.7983963 1.044107 1.265705
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 0.599045 0.9300464 -1.607802 -0.3350725 0.2314099 0.1471647 0.5972841
[2,] 0.599045 0.9300464 -1.607802 -0.3350725 0.2314099 0.1471647 0.5972841
[,99] [,100]
[1,] 0.8706001 1.433077
[2,] 0.8706001 1.433077
>
>
> Max(tmp2)
[1] 2.569008
> Min(tmp2)
[1] -3.029526
> mean(tmp2)
[1] -0.008324937
> Sum(tmp2)
[1] -0.8324937
> Var(tmp2)
[1] 1.199236
>
> rowMeans(tmp2)
[1] -2.047667348 0.420965784 -1.564672595 0.052601875 2.437690911
[6] 0.683320938 0.174485338 0.747850890 -0.362759071 2.117680164
[11] 0.274751196 -0.400332605 1.324562018 0.178804258 1.009025450
[16] -0.296342770 0.671223714 1.171283227 -0.972614552 -0.614931066
[21] -1.165657931 -0.277102144 -2.709732608 2.569008293 -0.428361955
[26] -0.449768791 0.906044063 1.443383719 -0.646358952 1.111619618
[31] -0.011274258 -0.728497101 0.684207199 0.545756942 0.247737455
[36] 1.256925331 -1.158990403 -0.004817025 -0.582004249 -0.079259524
[41] -1.537181483 -2.260879927 -0.677147917 0.043863176 -0.025233350
[46] -0.912333479 1.477285041 -3.029526114 -1.115587177 0.703538193
[51] 0.449505015 -1.714712530 0.087216373 -2.398455978 -1.102458067
[56] 0.804390733 0.407546574 -1.099020551 0.989358434 -1.369906161
[61] -1.156764566 1.383090365 0.747023238 -0.594001682 0.341520258
[66] -0.482509416 0.714728668 1.997965118 -1.035078536 -0.792452900
[71] 1.051555733 0.674193942 0.098344091 -1.055093513 -1.438921625
[76] 0.807554650 0.902032142 -0.104604738 -0.799369315 -1.217439355
[81] 1.012958553 -0.031166267 1.133121873 1.490178253 0.768844902
[86] 0.025339187 -0.242977170 -0.875956658 1.519418302 0.321730440
[91] -0.133635819 0.703159415 -0.459963426 0.094093506 0.475048754
[96] -0.015088889 -0.545366604 0.912031951 1.015754540 -1.289835346
> rowSums(tmp2)
[1] -2.047667348 0.420965784 -1.564672595 0.052601875 2.437690911
[6] 0.683320938 0.174485338 0.747850890 -0.362759071 2.117680164
[11] 0.274751196 -0.400332605 1.324562018 0.178804258 1.009025450
[16] -0.296342770 0.671223714 1.171283227 -0.972614552 -0.614931066
[21] -1.165657931 -0.277102144 -2.709732608 2.569008293 -0.428361955
[26] -0.449768791 0.906044063 1.443383719 -0.646358952 1.111619618
[31] -0.011274258 -0.728497101 0.684207199 0.545756942 0.247737455
[36] 1.256925331 -1.158990403 -0.004817025 -0.582004249 -0.079259524
[41] -1.537181483 -2.260879927 -0.677147917 0.043863176 -0.025233350
[46] -0.912333479 1.477285041 -3.029526114 -1.115587177 0.703538193
[51] 0.449505015 -1.714712530 0.087216373 -2.398455978 -1.102458067
[56] 0.804390733 0.407546574 -1.099020551 0.989358434 -1.369906161
[61] -1.156764566 1.383090365 0.747023238 -0.594001682 0.341520258
[66] -0.482509416 0.714728668 1.997965118 -1.035078536 -0.792452900
[71] 1.051555733 0.674193942 0.098344091 -1.055093513 -1.438921625
[76] 0.807554650 0.902032142 -0.104604738 -0.799369315 -1.217439355
[81] 1.012958553 -0.031166267 1.133121873 1.490178253 0.768844902
[86] 0.025339187 -0.242977170 -0.875956658 1.519418302 0.321730440
[91] -0.133635819 0.703159415 -0.459963426 0.094093506 0.475048754
[96] -0.015088889 -0.545366604 0.912031951 1.015754540 -1.289835346
> 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] -2.047667348 0.420965784 -1.564672595 0.052601875 2.437690911
[6] 0.683320938 0.174485338 0.747850890 -0.362759071 2.117680164
[11] 0.274751196 -0.400332605 1.324562018 0.178804258 1.009025450
[16] -0.296342770 0.671223714 1.171283227 -0.972614552 -0.614931066
[21] -1.165657931 -0.277102144 -2.709732608 2.569008293 -0.428361955
[26] -0.449768791 0.906044063 1.443383719 -0.646358952 1.111619618
[31] -0.011274258 -0.728497101 0.684207199 0.545756942 0.247737455
[36] 1.256925331 -1.158990403 -0.004817025 -0.582004249 -0.079259524
[41] -1.537181483 -2.260879927 -0.677147917 0.043863176 -0.025233350
[46] -0.912333479 1.477285041 -3.029526114 -1.115587177 0.703538193
[51] 0.449505015 -1.714712530 0.087216373 -2.398455978 -1.102458067
[56] 0.804390733 0.407546574 -1.099020551 0.989358434 -1.369906161
[61] -1.156764566 1.383090365 0.747023238 -0.594001682 0.341520258
[66] -0.482509416 0.714728668 1.997965118 -1.035078536 -0.792452900
[71] 1.051555733 0.674193942 0.098344091 -1.055093513 -1.438921625
[76] 0.807554650 0.902032142 -0.104604738 -0.799369315 -1.217439355
[81] 1.012958553 -0.031166267 1.133121873 1.490178253 0.768844902
[86] 0.025339187 -0.242977170 -0.875956658 1.519418302 0.321730440
[91] -0.133635819 0.703159415 -0.459963426 0.094093506 0.475048754
[96] -0.015088889 -0.545366604 0.912031951 1.015754540 -1.289835346
> rowMin(tmp2)
[1] -2.047667348 0.420965784 -1.564672595 0.052601875 2.437690911
[6] 0.683320938 0.174485338 0.747850890 -0.362759071 2.117680164
[11] 0.274751196 -0.400332605 1.324562018 0.178804258 1.009025450
[16] -0.296342770 0.671223714 1.171283227 -0.972614552 -0.614931066
[21] -1.165657931 -0.277102144 -2.709732608 2.569008293 -0.428361955
[26] -0.449768791 0.906044063 1.443383719 -0.646358952 1.111619618
[31] -0.011274258 -0.728497101 0.684207199 0.545756942 0.247737455
[36] 1.256925331 -1.158990403 -0.004817025 -0.582004249 -0.079259524
[41] -1.537181483 -2.260879927 -0.677147917 0.043863176 -0.025233350
[46] -0.912333479 1.477285041 -3.029526114 -1.115587177 0.703538193
[51] 0.449505015 -1.714712530 0.087216373 -2.398455978 -1.102458067
[56] 0.804390733 0.407546574 -1.099020551 0.989358434 -1.369906161
[61] -1.156764566 1.383090365 0.747023238 -0.594001682 0.341520258
[66] -0.482509416 0.714728668 1.997965118 -1.035078536 -0.792452900
[71] 1.051555733 0.674193942 0.098344091 -1.055093513 -1.438921625
[76] 0.807554650 0.902032142 -0.104604738 -0.799369315 -1.217439355
[81] 1.012958553 -0.031166267 1.133121873 1.490178253 0.768844902
[86] 0.025339187 -0.242977170 -0.875956658 1.519418302 0.321730440
[91] -0.133635819 0.703159415 -0.459963426 0.094093506 0.475048754
[96] -0.015088889 -0.545366604 0.912031951 1.015754540 -1.289835346
>
> colMeans(tmp2)
[1] -0.008324937
> colSums(tmp2)
[1] -0.8324937
> colVars(tmp2)
[1] 1.199236
> colSd(tmp2)
[1] 1.095096
> colMax(tmp2)
[1] 2.569008
> colMin(tmp2)
[1] -3.029526
> colMedians(tmp2)
[1] 0.03460118
> colRanges(tmp2)
[,1]
[1,] -3.029526
[2,] 2.569008
>
> 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.5075123 4.7804042 -3.2608565 5.7265735 -1.8624604 -1.7760039
[7] 3.5263648 -0.3179887 -3.5687480 0.7438497
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.1546609
[2,] -0.6950173
[3,] -0.2202425
[4,] 0.3129204
[5,] 1.7871716
>
> rowApply(tmp,sum)
[1] -0.4854557 0.8867772 -0.5533953 -4.3604289 -1.9841447 5.5942526
[7] 2.9731871 2.2736889 -1.7711348 -1.0897240
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 2 5 3 7 5 10 7
[2,] 8 3 4 6 7 9 4 10 5 10
[3,] 5 1 10 1 10 2 6 2 3 5
[4,] 7 8 8 9 6 4 8 9 9 2
[5,] 4 9 2 4 4 6 1 8 2 8
[6,] 2 7 7 5 2 10 5 4 4 3
[7,] 9 5 9 8 9 1 9 7 1 9
[8,] 6 6 1 3 8 7 10 6 8 6
[9,] 3 4 5 7 3 5 2 1 6 4
[10,] 10 10 6 10 1 8 3 3 7 1
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 3.1669985 0.4661592 -0.8089292 -0.6367319 0.9533430 0.5649609
[7] -0.5712692 1.3670696 2.2192003 4.8548902 -5.3713179 2.4152399
[13] 0.4801756 -0.1742815 -2.6010288 0.1379517 -2.3369513 -2.0118410
[19] -0.9818325 -1.1718314
> colApply(tmp,quantile)[,1]
[,1]
[1,] 0.1495135
[2,] 0.2486320
[3,] 0.6390726
[4,] 0.7275902
[5,] 1.4021903
>
> rowApply(tmp,sum)
[1] -2.428735 -1.785320 6.698998 -5.072205 2.547237
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 19 17 19 12 11
[2,] 12 6 3 14 18
[3,] 7 10 4 8 17
[4,] 3 16 18 5 6
[5,] 8 1 14 20 13
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.7275902 -0.04006883 -0.5230155 -0.9223928 -0.4087813 0.62261811
[2,] 0.6390726 -0.48682002 -0.3672959 0.6147656 -1.2964781 0.98571479
[3,] 1.4021903 -0.56266785 -0.4904725 1.2270327 0.9257599 0.70609464
[4,] 0.1495135 0.34048587 -0.6042080 -1.0098550 1.2670134 -1.72763237
[5,] 0.2486320 1.21523003 1.1760628 -0.5462825 0.4658292 -0.02183429
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.2940087 0.008894454 -0.5777298 0.4965161 -0.7876132 1.61432735
[2,] -0.1425432 0.284460908 0.9947993 2.1372320 -0.4787473 -0.39195856
[3,] -0.3409323 1.000335704 -0.2480890 0.5615443 -1.3364666 -0.02422892
[4,] -0.9703317 0.976932444 0.7681562 0.7493272 -1.5558416 0.33158987
[5,] 0.5885293 -0.903553875 1.2820636 0.9102706 -1.2126493 0.88551016
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.2285654 -1.2764119 -0.06769175 0.3491269 -0.5611386 -0.3728378
[2,] -0.1537243 -1.0027161 -1.14050635 -0.3989401 -0.8799811 0.3056480
[3,] 0.6843587 -0.1282400 -0.15833919 0.5867202 1.4303807 1.0530571
[4,] -0.5413825 0.4618449 -0.90267754 0.8801487 -1.1306419 -1.9931942
[5,] 0.2623581 1.7712417 -0.33181395 -1.2791040 -1.1955705 -1.0045140
[,19] [,20]
[1,] -1.0740184 -0.15868213
[2,] -0.8740429 -0.13325979
[3,] 1.0740032 -0.66304308
[4,] -0.3117540 -0.24969823
[5,] 0.2039796 0.03285187
>
>
> 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 : 649 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 : 561 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 col8
row1 0.5913586 1.058566 0.5217361 0.0998 -0.5908187 0.5613206 1.387893 0.739626
col9 col10 col11 col12 col13 col14 col15
row1 0.582805 0.3000517 -1.448628 0.2320985 -0.795025 -0.9678212 0.1831264
col16 col17 col18 col19 col20
row1 1.017727 0.1593223 0.9111176 0.9026814 -0.1102819
> tmp[,"col10"]
col10
row1 0.3000517
row2 -0.4290084
row3 0.3866780
row4 2.8033980
row5 1.1868702
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 0.5913586 1.058566 0.5217361 0.09980 -0.5908187 0.5613206 1.3878929
row5 0.9238284 1.068568 -0.9087252 1.00912 0.4175494 -0.7992172 -0.1719048
col8 col9 col10 col11 col12 col13 col14
row1 0.739626 0.5828050 0.3000517 -1.4486284 0.2320985 -0.7950250 -0.9678212
row5 -1.467853 0.1197158 1.1868702 -0.2323119 1.4331806 0.4116754 -0.5030903
col15 col16 col17 col18 col19 col20
row1 0.1831264 1.0177270 0.1593223 0.9111176 0.9026814 -0.1102819
row5 0.8517373 0.5976969 -0.2996007 -2.2316642 0.8849756 0.2735834
> tmp[,c("col6","col20")]
col6 col20
row1 0.5613206 -0.1102819
row2 0.7690660 0.9812334
row3 -0.2919063 0.5774625
row4 -0.7112874 -0.7847421
row5 -0.7992172 0.2735834
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.5613206 -0.1102819
row5 -0.7992172 0.2735834
>
>
>
>
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105)
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.30657 48.35864 50.88501 50.27966 51.18573 104.358 50.74979 49.15471
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.15934 50.0062 50.81871 51.04199 47.29704 49.34496 49.50208 49.36201
col17 col18 col19 col20
row1 50.95934 50.82003 49.44533 104.049
> tmp[,"col10"]
col10
row1 50.00620
row2 29.20032
row3 30.02114
row4 28.89684
row5 48.65248
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.30657 48.35864 50.88501 50.27966 51.18573 104.358 50.74979 49.15471
row5 50.06718 49.94070 48.70369 51.32838 49.81575 105.264 47.21613 47.75203
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.15934 50.00620 50.81871 51.04199 47.29704 49.34496 49.50208 49.36201
row5 50.82684 48.65248 49.12193 49.95944 50.70197 50.30137 49.56877 50.37044
col17 col18 col19 col20
row1 50.95934 50.82003 49.44533 104.0490
row5 49.87395 50.13006 49.47238 104.7129
> tmp[,c("col6","col20")]
col6 col20
row1 104.35802 104.04896
row2 75.33988 74.46025
row3 74.58129 72.79112
row4 74.38876 74.12294
row5 105.26402 104.71294
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.358 104.0490
row5 105.264 104.7129
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.358 104.0490
row5 105.264 104.7129
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.3188936
[2,] -0.1547134
[3,] 0.9580991
[4,] 1.6205312
[5,] -1.1588222
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.7262405 -0.5386235
[2,] 0.8696036 -0.6816811
[3,] -0.2416009 0.3066235
[4,] -0.2094616 0.2730194
[5,] 0.7922650 1.0894648
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.08145411 0.44571600
[2,] 0.91495411 -0.53922954
[3,] 0.45997128 -0.07776894
[4,] -1.79544360 -0.67137102
[5,] -1.83513252 -0.59147522
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.08145411
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.08145411
[2,] 0.91495411
>
>
>
> 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.4125867 2.1247585 -0.164438 -2.1497913 1.7189768 1.7853516 -0.4309293
row1 0.2137598 0.2347943 1.220282 0.7785484 0.6650106 -0.4554156 -0.1055076
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 1.517354 -1.0814900 -1.262592 0.9523515 0.9339777 0.6261398 -1.6903195
row1 1.018019 -0.5124396 0.374768 -1.2446805 1.9949168 -0.7683302 0.4723634
[,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.9649608 0.08974268 0.5235320 -0.9889852 -1.1617062 -0.4369798
row1 -0.9354112 0.07148018 -0.5582026 -1.4569954 0.5484346 0.1906249
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -1.382003 0.2153993 0.05858499 -0.7796634 0.04002383 -0.2167948 -1.577767
[,8] [,9] [,10]
row2 -1.349739 -0.920565 0.06357057
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.6424228 -0.7082794 -0.2347398 0.2957632 -0.3883752 -0.9663491 0.4611649
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.8996632 1.549942 -0.8516686 0.4482584 1.089878 -0.09075464 0.8264974
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.9643799 -1.072048 -0.7211832 0.8419091 -0.3070931 -0.4281439
>
>
> 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: 0x5e3a1e348350>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMb67bc511ebd72"
[2] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMb67bc402750d9"
[3] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMb67bc77422278"
[4] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMb67bc215e8b39"
[5] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMb67bc4b164453"
[6] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMb67bc2c4bf310"
[7] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMb67bc576d3101"
[8] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMb67bc553b18cc"
[9] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMb67bc19e1080f"
[10] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMb67bc76aca41e"
[11] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMb67bc735c6b61"
[12] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMb67bc2db5a44c"
[13] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMb67bc1278e050"
[14] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMb67bc2cc7a6b6"
[15] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BMb67bc632cc7d1"
>
>
> ### 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: 0x5e3a1ef53f90>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5e3a1ef53f90>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5e3a1ef53f90>
> rowMedians(tmp)
[1] 0.14990810 0.36530561 0.03262671 0.14493968 0.02721811 0.26758420
[7] 0.44572511 0.05723600 0.44409111 -0.37990434 0.06080810 -0.12305083
[13] -0.17831134 0.15364920 0.29077176 -0.53739689 0.01185492 0.32595211
[19] -0.75818304 -0.35483811 -0.69079055 -0.62721706 0.51666196 -0.08781263
[25] -0.14253279 0.06134865 -0.19568741 -0.41317639 -0.26987604 -0.03483717
[31] 0.08882859 -0.15874847 -0.23070071 0.49924706 -0.07949428 -0.11120211
[37] 0.23545616 -0.24333792 -0.61803341 0.36247126 -0.47513907 -0.30337549
[43] -0.06089087 -0.26387651 0.36134846 -0.14043511 0.11868796 0.36935249
[49] 0.46899469 -0.55800216 -0.39071326 0.50896656 -0.25376538 0.18227671
[55] -0.40891759 -0.03770916 0.77962361 -0.27823181 0.12066947 -0.41303899
[61] -0.22554276 0.22636277 0.03006310 0.46191282 0.32086986 0.27453286
[67] 0.02967929 0.24386419 -0.08759995 -0.16653350 -0.27153977 -0.02656838
[73] 0.18260981 -0.45989307 0.10301057 -0.33090695 -0.55661992 0.34081884
[79] -0.41247680 0.20425652 -0.36179399 0.52566397 -0.31538127 0.19236185
[85] 0.49535009 0.14536022 0.22822895 0.57062077 -0.67734482 -0.16955369
[91] -0.02864228 -0.06524661 -0.21391548 -0.27974904 -0.34276219 0.31684381
[97] -0.13650859 0.06997662 -0.05937199 -0.13570969 -0.05106822 -0.49960468
[103] -0.20793493 -0.59795830 -0.30004933 -0.19427922 -0.54445625 0.32244200
[109] -0.13998523 0.35746501 0.10023910 0.16103505 0.21591656 -0.41178787
[115] -0.46289465 0.13458831 -0.03446839 0.40169459 0.32171193 -0.28528064
[121] -0.17311181 -0.04869937 0.46759909 -0.06541451 -0.21397772 -0.08971800
[127] 0.03633331 0.32107970 0.30749808 0.22947831 0.13485715 -0.03066727
[133] 0.43630689 -0.25759593 0.43667937 0.34711335 0.23628758 -0.35759341
[139] 0.12936024 -0.28295438 0.05510026 0.25595507 0.22078781 -0.11340451
[145] 0.30611628 -0.01546495 -0.50691246 0.03220346 0.46621081 0.32932217
[151] -0.10984797 -0.13797396 -0.33108486 -0.26957093 -0.48322137 -0.44952387
[157] 0.37981929 -0.29349782 -0.31717682 0.38462069 -0.46694912 -0.41943516
[163] -0.10357178 -0.36228575 0.09983687 -0.19651755 0.20582623 -0.32432991
[169] 0.24957017 -0.19599607 -0.09271915 0.23312489 -0.11748964 0.45455779
[175] 0.12921271 0.29239889 0.25108956 0.21968116 -0.14981728 0.03317552
[181] 0.22013084 -0.01818428 0.06529216 0.54537174 0.72527364 0.24107991
[187] -0.64778393 -0.03277435 -0.20551656 0.05223898 -0.20597523 -0.68705035
[193] -0.61342090 -0.04281235 0.31658387 0.32674403 -0.34411446 0.51698791
[199] 0.50777681 -0.23183539 -0.21014053 0.04118178 0.28391086 -0.38926272
[205] -0.56519598 -0.15651276 -0.59812017 -0.37069042 -0.18955178 0.17339843
[211] -0.50808556 0.10204603 -0.03686692 0.36663690 0.54348186 -0.12657452
[217] -0.35296287 -0.01139761 -0.45011722 -0.06901478 -0.34792894 -0.54601603
[223] 0.92685495 -0.23343394 -0.25543013 0.37074827 0.19728799 -0.23502963
[229] 0.15663475 0.31977470
>
> proc.time()
user system elapsed
1.287 0.671 1.947
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: 0x5dbc69d86520>
> .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: 0x5dbc69d86520>
> .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: 0x5dbc69d86520>
> .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: 0x5dbc69d86520>
> 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: 0x5dbc6992ff60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5dbc6992ff60>
> .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: 0x5dbc6992ff60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5dbc6992ff60>
> .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: 0x5dbc6992ff60>
> 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: 0x5dbc6a4d9b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5dbc6a4d9b40>
> .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: 0x5dbc6a4d9b40>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5dbc6a4d9b40>
> .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: 0x5dbc6a4d9b40>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5dbc6a4d9b40>
> .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: 0x5dbc6a4d9b40>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5dbc6a4d9b40>
> .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: 0x5dbc6a4d9b40>
> 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: 0x5dbc6a516bc0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5dbc6a516bc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5dbc6a516bc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5dbc6a516bc0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFileb69674a223b1a" "BufferedMatrixFileb696776e59ef7"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFileb69674a223b1a" "BufferedMatrixFileb696776e59ef7"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5dbc6a4b0000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5dbc6a4b0000>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5dbc6a4b0000>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5dbc6a4b0000>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5dbc6a4b0000>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5dbc6a4b0000>
> .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: 0x5dbc695e3e30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5dbc695e3e30>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5dbc695e3e30>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5dbc695e3e30>
> 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: 0x5dbc69c0da50>
> .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: 0x5dbc69c0da50>
> rm(P)
>
> proc.time()
user system elapsed
0.248 0.048 0.282
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.250 0.040 0.277