| Back to Build/check report for BioC 3.24: simplified long |
|
This page was generated on 2026-04-24 11:32 -0400 (Fri, 24 Apr 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" | 4800 |
| 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 249/2351 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.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.75.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.75.0.tar.gz |
| StartedAt: 2026-04-23 21:41:29 -0400 (Thu, 23 Apr 2026) |
| EndedAt: 2026-04-23 21:41:57 -0400 (Thu, 23 Apr 2026) |
| EllapsedTime: 28.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.75.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-04-24 01:41:29 UTC
* 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.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.75.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.266 0.051 0.306
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 Apr 23 21:41:47 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 Apr 23 21:41:47 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: 0x61b88d9a7520>
>
>
>
> 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 Apr 23 21:41:48 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 Apr 23 21:41:48 2026"
>
> ColMode(tmp2)
<pointer: 0x61b88d9a7520>
>
>
>
> ### 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.96699264 -0.1626936 0.3219613 -0.8380369
[2,] -0.52917714 -0.5606689 0.8917266 0.7315091
[3,] -0.01288198 0.2725359 0.6287951 -1.3876137
[4,] -1.34853211 -0.2786202 -0.5325509 0.3343665
> 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 : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 99.96699264 0.1626936 0.3219613 0.8380369
[2,] 0.52917714 0.5606689 0.8917266 0.7315091
[3,] 0.01288198 0.2725359 0.6287951 1.3876137
[4,] 1.34853211 0.2786202 0.5325509 0.3343665
> 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 : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 9.9983495 0.4033530 0.5674164 0.9154436
[2,] 0.7274456 0.7487782 0.9443128 0.8552831
[3,] 0.1134988 0.5220498 0.7929660 1.1779702
[4,] 1.1612632 0.5278448 0.7297609 0.5782444
>
> 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 : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 224.95049 29.19622 30.99612 34.99247
[2,] 32.80363 33.04845 35.33485 34.28434
[3,] 26.14787 30.49303 33.55846 38.16732
[4,] 37.96116 30.55707 32.83016 31.11681
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x61b88f1a09d0>
> exp(tmp5)
<pointer: 0x61b88f1a09d0>
> log(tmp5,2)
<pointer: 0x61b88f1a09d0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.205
> Min(tmp5)
[1] 52.61865
> mean(tmp5)
[1] 72.94847
> Sum(tmp5)
[1] 14589.69
> Var(tmp5)
[1] 857.5719
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.07194 71.50857 68.24785 71.07654 71.98280 73.18213 71.89108 69.44784
[9] 70.12048 71.95549
> rowSums(tmp5)
[1] 1801.439 1430.171 1364.957 1421.531 1439.656 1463.643 1437.822 1388.957
[9] 1402.410 1439.110
> rowVars(tmp5)
[1] 8019.70154 47.96095 146.12832 51.58027 34.80798 62.56786
[7] 83.65609 73.50404 50.68945 48.99363
> rowSd(tmp5)
[1] 89.552786 6.925385 12.088355 7.181940 5.899829 7.909985 9.146370
[8] 8.573449 7.119653 6.999545
> rowMax(tmp5)
[1] 468.20497 81.43528 89.91489 83.25713 83.87453 84.66041 87.36392
[8] 83.26500 84.51580 88.40410
> rowMin(tmp5)
[1] 54.69470 57.28983 54.06696 60.05034 61.51938 56.08199 57.06108 52.61865
[9] 57.97755 61.75859
>
> colMeans(tmp5)
[1] 110.51510 71.08022 65.99975 70.04859 69.28172 70.85230 72.95888
[8] 73.25969 73.87766 67.65357 68.35398 71.82750 69.23688 72.19946
[15] 73.57077 74.52435 68.76852 73.33863 74.30925 67.31262
> colSums(tmp5)
[1] 1105.1510 710.8022 659.9975 700.4859 692.8172 708.5230 729.5888
[8] 732.5969 738.7766 676.5357 683.5398 718.2750 692.3688 721.9946
[15] 735.7077 745.2435 687.6852 733.3863 743.0925 673.1262
> colVars(tmp5)
[1] 15890.56105 61.51079 25.75503 41.34433 66.54036 115.61721
[7] 32.16535 86.79131 110.14951 66.82928 50.21050 53.55649
[13] 95.53719 42.23869 58.25105 93.97174 72.04566 65.91215
[19] 86.30735 58.70129
> colSd(tmp5)
[1] 126.057769 7.842882 5.074941 6.429955 8.157228 10.752545
[7] 5.671450 9.316186 10.495214 8.174918 7.085936 7.318230
[13] 9.774313 6.499130 7.632237 9.693902 8.487972 8.118630
[19] 9.290175 7.661677
> colMax(tmp5)
[1] 468.20497 82.70671 73.54487 79.44027 81.43528 84.66041 81.39004
[8] 89.91489 84.46491 77.65785 78.93151 80.80715 83.26500 83.67629
[15] 87.36392 88.40410 81.84552 86.41553 86.27174 78.93482
> colMin(tmp5)
[1] 54.42337 60.76811 59.05966 59.95568 59.61352 59.22863 63.08673 57.23829
[9] 59.85163 57.28983 57.97755 56.39326 54.06696 64.81797 64.27689 55.87354
[17] 52.61865 58.42467 57.67249 56.19177
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 90.07194 71.50857 68.24785 NA 71.98280 73.18213 71.89108 69.44784
[9] 70.12048 71.95549
> rowSums(tmp5)
[1] 1801.439 1430.171 1364.957 NA 1439.656 1463.643 1437.822 1388.957
[9] 1402.410 1439.110
> rowVars(tmp5)
[1] 8019.70154 47.96095 146.12832 53.84905 34.80798 62.56786
[7] 83.65609 73.50404 50.68945 48.99363
> rowSd(tmp5)
[1] 89.552786 6.925385 12.088355 7.338191 5.899829 7.909985 9.146370
[8] 8.573449 7.119653 6.999545
> rowMax(tmp5)
[1] 468.20497 81.43528 89.91489 NA 83.87453 84.66041 87.36392
[8] 83.26500 84.51580 88.40410
> rowMin(tmp5)
[1] 54.69470 57.28983 54.06696 NA 61.51938 56.08199 57.06108 52.61865
[9] 57.97755 61.75859
>
> colMeans(tmp5)
[1] 110.51510 71.08022 65.99975 70.04859 69.28172 70.85230 72.95888
[8] 73.25969 73.87766 67.65357 68.35398 71.82750 69.23688 72.19946
[15] NA 74.52435 68.76852 73.33863 74.30925 67.31262
> colSums(tmp5)
[1] 1105.1510 710.8022 659.9975 700.4859 692.8172 708.5230 729.5888
[8] 732.5969 738.7766 676.5357 683.5398 718.2750 692.3688 721.9946
[15] NA 745.2435 687.6852 733.3863 743.0925 673.1262
> colVars(tmp5)
[1] 15890.56105 61.51079 25.75503 41.34433 66.54036 115.61721
[7] 32.16535 86.79131 110.14951 66.82928 50.21050 53.55649
[13] 95.53719 42.23869 NA 93.97174 72.04566 65.91215
[19] 86.30735 58.70129
> colSd(tmp5)
[1] 126.057769 7.842882 5.074941 6.429955 8.157228 10.752545
[7] 5.671450 9.316186 10.495214 8.174918 7.085936 7.318230
[13] 9.774313 6.499130 NA 9.693902 8.487972 8.118630
[19] 9.290175 7.661677
> colMax(tmp5)
[1] 468.20497 82.70671 73.54487 79.44027 81.43528 84.66041 81.39004
[8] 89.91489 84.46491 77.65785 78.93151 80.80715 83.26500 83.67629
[15] NA 88.40410 81.84552 86.41553 86.27174 78.93482
> colMin(tmp5)
[1] 54.42337 60.76811 59.05966 59.95568 59.61352 59.22863 63.08673 57.23829
[9] 59.85163 57.28983 57.97755 56.39326 54.06696 64.81797 NA 55.87354
[17] 52.61865 58.42467 57.67249 56.19177
>
> Max(tmp5,na.rm=TRUE)
[1] 468.205
> Min(tmp5,na.rm=TRUE)
[1] 52.61865
> mean(tmp5,na.rm=TRUE)
[1] 72.97393
> Sum(tmp5,na.rm=TRUE)
[1] 14521.81
> Var(tmp5,na.rm=TRUE)
[1] 861.7728
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.07194 71.50857 68.24785 71.24467 71.98280 73.18213 71.89108 69.44784
[9] 70.12048 71.95549
> rowSums(tmp5,na.rm=TRUE)
[1] 1801.439 1430.171 1364.957 1353.649 1439.656 1463.643 1437.822 1388.957
[9] 1402.410 1439.110
> rowVars(tmp5,na.rm=TRUE)
[1] 8019.70154 47.96095 146.12832 53.84905 34.80798 62.56786
[7] 83.65609 73.50404 50.68945 48.99363
> rowSd(tmp5,na.rm=TRUE)
[1] 89.552786 6.925385 12.088355 7.338191 5.899829 7.909985 9.146370
[8] 8.573449 7.119653 6.999545
> rowMax(tmp5,na.rm=TRUE)
[1] 468.20497 81.43528 89.91489 83.25713 83.87453 84.66041 87.36392
[8] 83.26500 84.51580 88.40410
> rowMin(tmp5,na.rm=TRUE)
[1] 54.69470 57.28983 54.06696 60.05034 61.51938 56.08199 57.06108 52.61865
[9] 57.97755 61.75859
>
> colMeans(tmp5,na.rm=TRUE)
[1] 110.51510 71.08022 65.99975 70.04859 69.28172 70.85230 72.95888
[8] 73.25969 73.87766 67.65357 68.35398 71.82750 69.23688 72.19946
[15] 74.20285 74.52435 68.76852 73.33863 74.30925 67.31262
> colSums(tmp5,na.rm=TRUE)
[1] 1105.1510 710.8022 659.9975 700.4859 692.8172 708.5230 729.5888
[8] 732.5969 738.7766 676.5357 683.5398 718.2750 692.3688 721.9946
[15] 667.8257 745.2435 687.6852 733.3863 743.0925 673.1262
> colVars(tmp5,na.rm=TRUE)
[1] 15890.56105 61.51079 25.75503 41.34433 66.54036 115.61721
[7] 32.16535 86.79131 110.14951 66.82928 50.21050 53.55649
[13] 95.53719 42.23869 61.03769 93.97174 72.04566 65.91215
[19] 86.30735 58.70129
> colSd(tmp5,na.rm=TRUE)
[1] 126.057769 7.842882 5.074941 6.429955 8.157228 10.752545
[7] 5.671450 9.316186 10.495214 8.174918 7.085936 7.318230
[13] 9.774313 6.499130 7.812662 9.693902 8.487972 8.118630
[19] 9.290175 7.661677
> colMax(tmp5,na.rm=TRUE)
[1] 468.20497 82.70671 73.54487 79.44027 81.43528 84.66041 81.39004
[8] 89.91489 84.46491 77.65785 78.93151 80.80715 83.26500 83.67629
[15] 87.36392 88.40410 81.84552 86.41553 86.27174 78.93482
> colMin(tmp5,na.rm=TRUE)
[1] 54.42337 60.76811 59.05966 59.95568 59.61352 59.22863 63.08673 57.23829
[9] 59.85163 57.28983 57.97755 56.39326 54.06696 64.81797 64.27689 55.87354
[17] 52.61865 58.42467 57.67249 56.19177
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.07194 71.50857 68.24785 NaN 71.98280 73.18213 71.89108 69.44784
[9] 70.12048 71.95549
> rowSums(tmp5,na.rm=TRUE)
[1] 1801.439 1430.171 1364.957 0.000 1439.656 1463.643 1437.822 1388.957
[9] 1402.410 1439.110
> rowVars(tmp5,na.rm=TRUE)
[1] 8019.70154 47.96095 146.12832 NA 34.80798 62.56786
[7] 83.65609 73.50404 50.68945 48.99363
> rowSd(tmp5,na.rm=TRUE)
[1] 89.552786 6.925385 12.088355 NA 5.899829 7.909985 9.146370
[8] 8.573449 7.119653 6.999545
> rowMax(tmp5,na.rm=TRUE)
[1] 468.20497 81.43528 89.91489 NA 83.87453 84.66041 87.36392
[8] 83.26500 84.51580 88.40410
> rowMin(tmp5,na.rm=TRUE)
[1] 54.69470 57.28983 54.06696 NA 61.51938 56.08199 57.06108 52.61865
[9] 57.97755 61.75859
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 114.01554 71.91130 65.74065 70.63559 70.30743 72.03583 72.72170
[8] 73.61927 72.83549 66.80657 68.41331 71.23630 69.94737 72.11926
[15] NaN 74.18469 68.45416 72.57198 73.66327 67.70675
> colSums(tmp5,na.rm=TRUE)
[1] 1026.1398 647.2017 591.6658 635.7203 632.7668 648.3225 654.4953
[8] 662.5734 655.5195 601.2591 615.7198 641.1267 629.5263 649.0734
[15] 0.0000 667.6622 616.0875 653.1479 662.9695 609.3607
> colVars(tmp5,na.rm=TRUE)
[1] 17739.03444 61.42941 28.21915 42.63593 63.02203 114.31095
[7] 35.55314 96.18569 111.69952 67.11213 56.44720 56.31895
[13] 101.80042 47.44616 NA 104.42025 79.93961 67.53904
[19] 92.40123 64.29141
> colSd(tmp5,na.rm=TRUE)
[1] 133.187967 7.837692 5.312170 6.529620 7.938642 10.691630
[7] 5.962645 9.807430 10.568799 8.192199 7.513135 7.504595
[13] 10.089619 6.888117 NA 10.218623 8.940896 8.218214
[19] 9.612556 8.018192
> colMax(tmp5,na.rm=TRUE)
[1] 468.20497 82.70671 73.54487 79.44027 81.43528 84.66041 81.39004
[8] 89.91489 84.46491 77.65785 78.93151 80.80715 83.26500 83.67629
[15] -Inf 88.40410 81.84552 86.41553 86.27174 78.93482
> colMin(tmp5,na.rm=TRUE)
[1] 54.42337 60.76811 59.05966 59.95568 59.61352 59.22863 63.08673 57.23829
[9] 59.85163 57.28983 57.97755 56.39326 54.06696 64.81797 Inf 55.87354
[17] 52.61865 58.42467 57.67249 56.19177
>
>
>
>
> 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] 182.1373 253.2833 195.9959 291.8176 227.6726 230.9557 256.5073 143.0426
[9] 203.8927 298.9841
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 182.1373 253.2833 195.9959 291.8176 227.6726 230.9557 256.5073 143.0426
[9] 203.8927 298.9841
>
>
>
> 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] 0.000000e+00 -1.989520e-13 -4.263256e-14 -3.410605e-13 -1.136868e-13
[6] 1.136868e-13 -1.705303e-13 -5.684342e-14 2.273737e-13 1.705303e-13
[11] 5.684342e-14 2.842171e-14 0.000000e+00 -2.842171e-14 4.973799e-14
[16] 0.000000e+00 -5.684342e-14 0.000000e+00 5.684342e-14 -1.136868e-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)
+ }
9 17
5 8
5 6
5 11
9 14
8 1
2 9
4 3
8 8
1 18
7 3
7 4
4 4
8 18
5 1
2 20
8 19
1 6
10 9
8 3
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] 3.115447
> Min(tmp)
[1] -2.311873
> mean(tmp)
[1] 0.1368478
> Sum(tmp)
[1] 13.68478
> Var(tmp)
[1] 0.9836498
>
> rowMeans(tmp)
[1] 0.1368478
> rowSums(tmp)
[1] 13.68478
> rowVars(tmp)
[1] 0.9836498
> rowSd(tmp)
[1] 0.9917912
> rowMax(tmp)
[1] 3.115447
> rowMin(tmp)
[1] -2.311873
>
> colMeans(tmp)
[1] 1.0756201417 1.9496575924 0.1578443220 0.9148255713 0.7600035701
[6] -0.3905950400 0.5708423398 -0.3342814846 0.6313531837 -0.2950157729
[11] -1.1420518815 1.9831874260 0.4232304004 0.0239522280 -0.7734722092
[16] 0.1488394878 -0.5614429869 0.3648140124 -1.9731935667 -0.0275198536
[21] -0.4723961690 0.2360160583 0.3415475138 1.5352228696 0.2479679656
[26] -0.8282721177 0.6971481094 1.4660674542 0.9706015321 -0.2827968797
[31] -0.4739792151 2.2736467438 -1.3250593424 0.7167224647 -1.1872843800
[36] 0.7654050462 0.8941396566 -0.9144043941 1.3293466247 -0.7564165791
[41] -0.2643055601 -0.4810553835 1.3078264617 0.4429596985 1.5715694694
[46] -0.4395650015 0.8034366734 0.9883465904 -0.6957857004 -0.0307027500
[51] 1.5919045870 -0.6362174966 2.0012911864 -0.3384489816 0.9793251260
[56] -0.1121069580 0.2750015296 0.0007296511 -0.5876757221 1.2238629896
[61] -0.7632492309 -0.0550770861 0.5305201920 -0.9124476298 0.1169432131
[66] 3.1154469270 0.4179934037 0.3634304409 0.8396536970 0.6162780036
[71] -0.8827306775 -0.3136935576 -0.1245466242 -0.8693556846 1.5229760256
[76] 1.5580823374 0.1116203319 0.4789052878 -0.9588786884 -1.2390236913
[81] 1.4742613756 -0.4837807371 -1.5337837049 0.8672783031 0.0157489446
[86] -0.2982443860 0.2981728230 -0.3012937622 -2.3118734287 -0.6450867320
[91] 0.4261534394 -0.4615027675 -0.6819311043 0.4580435717 -1.1324902892
[96] -1.4464345554 0.3657896641 -1.4490620099 1.6118987214 -0.9801379131
> colSums(tmp)
[1] 1.0756201417 1.9496575924 0.1578443220 0.9148255713 0.7600035701
[6] -0.3905950400 0.5708423398 -0.3342814846 0.6313531837 -0.2950157729
[11] -1.1420518815 1.9831874260 0.4232304004 0.0239522280 -0.7734722092
[16] 0.1488394878 -0.5614429869 0.3648140124 -1.9731935667 -0.0275198536
[21] -0.4723961690 0.2360160583 0.3415475138 1.5352228696 0.2479679656
[26] -0.8282721177 0.6971481094 1.4660674542 0.9706015321 -0.2827968797
[31] -0.4739792151 2.2736467438 -1.3250593424 0.7167224647 -1.1872843800
[36] 0.7654050462 0.8941396566 -0.9144043941 1.3293466247 -0.7564165791
[41] -0.2643055601 -0.4810553835 1.3078264617 0.4429596985 1.5715694694
[46] -0.4395650015 0.8034366734 0.9883465904 -0.6957857004 -0.0307027500
[51] 1.5919045870 -0.6362174966 2.0012911864 -0.3384489816 0.9793251260
[56] -0.1121069580 0.2750015296 0.0007296511 -0.5876757221 1.2238629896
[61] -0.7632492309 -0.0550770861 0.5305201920 -0.9124476298 0.1169432131
[66] 3.1154469270 0.4179934037 0.3634304409 0.8396536970 0.6162780036
[71] -0.8827306775 -0.3136935576 -0.1245466242 -0.8693556846 1.5229760256
[76] 1.5580823374 0.1116203319 0.4789052878 -0.9588786884 -1.2390236913
[81] 1.4742613756 -0.4837807371 -1.5337837049 0.8672783031 0.0157489446
[86] -0.2982443860 0.2981728230 -0.3012937622 -2.3118734287 -0.6450867320
[91] 0.4261534394 -0.4615027675 -0.6819311043 0.4580435717 -1.1324902892
[96] -1.4464345554 0.3657896641 -1.4490620099 1.6118987214 -0.9801379131
> 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] 1.0756201417 1.9496575924 0.1578443220 0.9148255713 0.7600035701
[6] -0.3905950400 0.5708423398 -0.3342814846 0.6313531837 -0.2950157729
[11] -1.1420518815 1.9831874260 0.4232304004 0.0239522280 -0.7734722092
[16] 0.1488394878 -0.5614429869 0.3648140124 -1.9731935667 -0.0275198536
[21] -0.4723961690 0.2360160583 0.3415475138 1.5352228696 0.2479679656
[26] -0.8282721177 0.6971481094 1.4660674542 0.9706015321 -0.2827968797
[31] -0.4739792151 2.2736467438 -1.3250593424 0.7167224647 -1.1872843800
[36] 0.7654050462 0.8941396566 -0.9144043941 1.3293466247 -0.7564165791
[41] -0.2643055601 -0.4810553835 1.3078264617 0.4429596985 1.5715694694
[46] -0.4395650015 0.8034366734 0.9883465904 -0.6957857004 -0.0307027500
[51] 1.5919045870 -0.6362174966 2.0012911864 -0.3384489816 0.9793251260
[56] -0.1121069580 0.2750015296 0.0007296511 -0.5876757221 1.2238629896
[61] -0.7632492309 -0.0550770861 0.5305201920 -0.9124476298 0.1169432131
[66] 3.1154469270 0.4179934037 0.3634304409 0.8396536970 0.6162780036
[71] -0.8827306775 -0.3136935576 -0.1245466242 -0.8693556846 1.5229760256
[76] 1.5580823374 0.1116203319 0.4789052878 -0.9588786884 -1.2390236913
[81] 1.4742613756 -0.4837807371 -1.5337837049 0.8672783031 0.0157489446
[86] -0.2982443860 0.2981728230 -0.3012937622 -2.3118734287 -0.6450867320
[91] 0.4261534394 -0.4615027675 -0.6819311043 0.4580435717 -1.1324902892
[96] -1.4464345554 0.3657896641 -1.4490620099 1.6118987214 -0.9801379131
> colMin(tmp)
[1] 1.0756201417 1.9496575924 0.1578443220 0.9148255713 0.7600035701
[6] -0.3905950400 0.5708423398 -0.3342814846 0.6313531837 -0.2950157729
[11] -1.1420518815 1.9831874260 0.4232304004 0.0239522280 -0.7734722092
[16] 0.1488394878 -0.5614429869 0.3648140124 -1.9731935667 -0.0275198536
[21] -0.4723961690 0.2360160583 0.3415475138 1.5352228696 0.2479679656
[26] -0.8282721177 0.6971481094 1.4660674542 0.9706015321 -0.2827968797
[31] -0.4739792151 2.2736467438 -1.3250593424 0.7167224647 -1.1872843800
[36] 0.7654050462 0.8941396566 -0.9144043941 1.3293466247 -0.7564165791
[41] -0.2643055601 -0.4810553835 1.3078264617 0.4429596985 1.5715694694
[46] -0.4395650015 0.8034366734 0.9883465904 -0.6957857004 -0.0307027500
[51] 1.5919045870 -0.6362174966 2.0012911864 -0.3384489816 0.9793251260
[56] -0.1121069580 0.2750015296 0.0007296511 -0.5876757221 1.2238629896
[61] -0.7632492309 -0.0550770861 0.5305201920 -0.9124476298 0.1169432131
[66] 3.1154469270 0.4179934037 0.3634304409 0.8396536970 0.6162780036
[71] -0.8827306775 -0.3136935576 -0.1245466242 -0.8693556846 1.5229760256
[76] 1.5580823374 0.1116203319 0.4789052878 -0.9588786884 -1.2390236913
[81] 1.4742613756 -0.4837807371 -1.5337837049 0.8672783031 0.0157489446
[86] -0.2982443860 0.2981728230 -0.3012937622 -2.3118734287 -0.6450867320
[91] 0.4261534394 -0.4615027675 -0.6819311043 0.4580435717 -1.1324902892
[96] -1.4464345554 0.3657896641 -1.4490620099 1.6118987214 -0.9801379131
> colMedians(tmp)
[1] 1.0756201417 1.9496575924 0.1578443220 0.9148255713 0.7600035701
[6] -0.3905950400 0.5708423398 -0.3342814846 0.6313531837 -0.2950157729
[11] -1.1420518815 1.9831874260 0.4232304004 0.0239522280 -0.7734722092
[16] 0.1488394878 -0.5614429869 0.3648140124 -1.9731935667 -0.0275198536
[21] -0.4723961690 0.2360160583 0.3415475138 1.5352228696 0.2479679656
[26] -0.8282721177 0.6971481094 1.4660674542 0.9706015321 -0.2827968797
[31] -0.4739792151 2.2736467438 -1.3250593424 0.7167224647 -1.1872843800
[36] 0.7654050462 0.8941396566 -0.9144043941 1.3293466247 -0.7564165791
[41] -0.2643055601 -0.4810553835 1.3078264617 0.4429596985 1.5715694694
[46] -0.4395650015 0.8034366734 0.9883465904 -0.6957857004 -0.0307027500
[51] 1.5919045870 -0.6362174966 2.0012911864 -0.3384489816 0.9793251260
[56] -0.1121069580 0.2750015296 0.0007296511 -0.5876757221 1.2238629896
[61] -0.7632492309 -0.0550770861 0.5305201920 -0.9124476298 0.1169432131
[66] 3.1154469270 0.4179934037 0.3634304409 0.8396536970 0.6162780036
[71] -0.8827306775 -0.3136935576 -0.1245466242 -0.8693556846 1.5229760256
[76] 1.5580823374 0.1116203319 0.4789052878 -0.9588786884 -1.2390236913
[81] 1.4742613756 -0.4837807371 -1.5337837049 0.8672783031 0.0157489446
[86] -0.2982443860 0.2981728230 -0.3012937622 -2.3118734287 -0.6450867320
[91] 0.4261534394 -0.4615027675 -0.6819311043 0.4580435717 -1.1324902892
[96] -1.4464345554 0.3657896641 -1.4490620099 1.6118987214 -0.9801379131
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 1.07562 1.949658 0.1578443 0.9148256 0.7600036 -0.390595 0.5708423
[2,] 1.07562 1.949658 0.1578443 0.9148256 0.7600036 -0.390595 0.5708423
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.3342815 0.6313532 -0.2950158 -1.142052 1.983187 0.4232304 0.02395223
[2,] -0.3342815 0.6313532 -0.2950158 -1.142052 1.983187 0.4232304 0.02395223
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.7734722 0.1488395 -0.561443 0.364814 -1.973194 -0.02751985 -0.4723962
[2,] -0.7734722 0.1488395 -0.561443 0.364814 -1.973194 -0.02751985 -0.4723962
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.2360161 0.3415475 1.535223 0.247968 -0.8282721 0.6971481 1.466067
[2,] 0.2360161 0.3415475 1.535223 0.247968 -0.8282721 0.6971481 1.466067
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.9706015 -0.2827969 -0.4739792 2.273647 -1.325059 0.7167225 -1.187284
[2,] 0.9706015 -0.2827969 -0.4739792 2.273647 -1.325059 0.7167225 -1.187284
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.765405 0.8941397 -0.9144044 1.329347 -0.7564166 -0.2643056 -0.4810554
[2,] 0.765405 0.8941397 -0.9144044 1.329347 -0.7564166 -0.2643056 -0.4810554
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 1.307826 0.4429597 1.571569 -0.439565 0.8034367 0.9883466 -0.6957857
[2,] 1.307826 0.4429597 1.571569 -0.439565 0.8034367 0.9883466 -0.6957857
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.03070275 1.591905 -0.6362175 2.001291 -0.338449 0.9793251 -0.112107
[2,] -0.03070275 1.591905 -0.6362175 2.001291 -0.338449 0.9793251 -0.112107
[,57] [,58] [,59] [,60] [,61] [,62]
[1,] 0.2750015 0.0007296511 -0.5876757 1.223863 -0.7632492 -0.05507709
[2,] 0.2750015 0.0007296511 -0.5876757 1.223863 -0.7632492 -0.05507709
[,63] [,64] [,65] [,66] [,67] [,68] [,69]
[1,] 0.5305202 -0.9124476 0.1169432 3.115447 0.4179934 0.3634304 0.8396537
[2,] 0.5305202 -0.9124476 0.1169432 3.115447 0.4179934 0.3634304 0.8396537
[,70] [,71] [,72] [,73] [,74] [,75] [,76]
[1,] 0.616278 -0.8827307 -0.3136936 -0.1245466 -0.8693557 1.522976 1.558082
[2,] 0.616278 -0.8827307 -0.3136936 -0.1245466 -0.8693557 1.522976 1.558082
[,77] [,78] [,79] [,80] [,81] [,82] [,83]
[1,] 0.1116203 0.4789053 -0.9588787 -1.239024 1.474261 -0.4837807 -1.533784
[2,] 0.1116203 0.4789053 -0.9588787 -1.239024 1.474261 -0.4837807 -1.533784
[,84] [,85] [,86] [,87] [,88] [,89] [,90]
[1,] 0.8672783 0.01574894 -0.2982444 0.2981728 -0.3012938 -2.311873 -0.6450867
[2,] 0.8672783 0.01574894 -0.2982444 0.2981728 -0.3012938 -2.311873 -0.6450867
[,91] [,92] [,93] [,94] [,95] [,96] [,97]
[1,] 0.4261534 -0.4615028 -0.6819311 0.4580436 -1.13249 -1.446435 0.3657897
[2,] 0.4261534 -0.4615028 -0.6819311 0.4580436 -1.13249 -1.446435 0.3657897
[,98] [,99] [,100]
[1,] -1.449062 1.611899 -0.9801379
[2,] -1.449062 1.611899 -0.9801379
>
>
> Max(tmp2)
[1] 2.776285
> Min(tmp2)
[1] -2.514898
> mean(tmp2)
[1] -0.1088307
> Sum(tmp2)
[1] -10.88307
> Var(tmp2)
[1] 1.171489
>
> rowMeans(tmp2)
[1] -0.101402419 -2.514897794 0.714304627 -1.763504333 2.374178331
[6] 0.808981752 0.295789964 0.889882178 0.681121839 1.542968665
[11] -0.454648092 -0.150628662 0.302414780 0.674783672 0.491458225
[16] -0.712048581 0.348810219 -1.122940458 0.398138268 0.289540540
[21] -0.794192941 -1.464171162 -0.645047627 -0.800936361 -1.405002232
[26] -0.553270258 -1.429980555 -0.369223308 -0.250518664 0.164000162
[31] -1.776790509 -0.260800884 0.047329968 -1.551692155 -1.125260190
[36] -0.348988406 -0.017506714 0.843295316 1.272730088 -0.823283129
[41] 0.007041011 2.201899340 1.439474948 0.194915209 0.256414927
[46] 1.380608107 1.942467199 0.030828009 -1.152216885 1.415037524
[51] 0.835204100 0.176128314 -1.708785596 -1.642887695 -0.736204103
[56] 0.325846110 -0.248453744 0.113368766 -1.171958084 -0.634916747
[61] -0.414070883 -0.427350307 -1.208171198 -0.293463596 -0.886541692
[66] -0.241545989 -0.774930819 2.028369308 -2.356229458 0.783847967
[71] -0.736497534 1.606597685 -1.268671030 -0.245116196 -0.248197803
[76] 0.814491097 0.672837815 -2.050700115 -0.956793528 -0.401348109
[81] 0.016502331 2.776285381 0.591468507 1.085680251 0.585254155
[86] -1.289190973 1.744028333 1.049109086 -0.259738987 -1.121070075
[91] 0.112965223 0.149489133 -0.448363589 -0.462442181 -1.762795931
[96] 0.608706071 -0.898905406 0.752459926 -0.293932673 -1.941893470
> rowSums(tmp2)
[1] -0.101402419 -2.514897794 0.714304627 -1.763504333 2.374178331
[6] 0.808981752 0.295789964 0.889882178 0.681121839 1.542968665
[11] -0.454648092 -0.150628662 0.302414780 0.674783672 0.491458225
[16] -0.712048581 0.348810219 -1.122940458 0.398138268 0.289540540
[21] -0.794192941 -1.464171162 -0.645047627 -0.800936361 -1.405002232
[26] -0.553270258 -1.429980555 -0.369223308 -0.250518664 0.164000162
[31] -1.776790509 -0.260800884 0.047329968 -1.551692155 -1.125260190
[36] -0.348988406 -0.017506714 0.843295316 1.272730088 -0.823283129
[41] 0.007041011 2.201899340 1.439474948 0.194915209 0.256414927
[46] 1.380608107 1.942467199 0.030828009 -1.152216885 1.415037524
[51] 0.835204100 0.176128314 -1.708785596 -1.642887695 -0.736204103
[56] 0.325846110 -0.248453744 0.113368766 -1.171958084 -0.634916747
[61] -0.414070883 -0.427350307 -1.208171198 -0.293463596 -0.886541692
[66] -0.241545989 -0.774930819 2.028369308 -2.356229458 0.783847967
[71] -0.736497534 1.606597685 -1.268671030 -0.245116196 -0.248197803
[76] 0.814491097 0.672837815 -2.050700115 -0.956793528 -0.401348109
[81] 0.016502331 2.776285381 0.591468507 1.085680251 0.585254155
[86] -1.289190973 1.744028333 1.049109086 -0.259738987 -1.121070075
[91] 0.112965223 0.149489133 -0.448363589 -0.462442181 -1.762795931
[96] 0.608706071 -0.898905406 0.752459926 -0.293932673 -1.941893470
> 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.101402419 -2.514897794 0.714304627 -1.763504333 2.374178331
[6] 0.808981752 0.295789964 0.889882178 0.681121839 1.542968665
[11] -0.454648092 -0.150628662 0.302414780 0.674783672 0.491458225
[16] -0.712048581 0.348810219 -1.122940458 0.398138268 0.289540540
[21] -0.794192941 -1.464171162 -0.645047627 -0.800936361 -1.405002232
[26] -0.553270258 -1.429980555 -0.369223308 -0.250518664 0.164000162
[31] -1.776790509 -0.260800884 0.047329968 -1.551692155 -1.125260190
[36] -0.348988406 -0.017506714 0.843295316 1.272730088 -0.823283129
[41] 0.007041011 2.201899340 1.439474948 0.194915209 0.256414927
[46] 1.380608107 1.942467199 0.030828009 -1.152216885 1.415037524
[51] 0.835204100 0.176128314 -1.708785596 -1.642887695 -0.736204103
[56] 0.325846110 -0.248453744 0.113368766 -1.171958084 -0.634916747
[61] -0.414070883 -0.427350307 -1.208171198 -0.293463596 -0.886541692
[66] -0.241545989 -0.774930819 2.028369308 -2.356229458 0.783847967
[71] -0.736497534 1.606597685 -1.268671030 -0.245116196 -0.248197803
[76] 0.814491097 0.672837815 -2.050700115 -0.956793528 -0.401348109
[81] 0.016502331 2.776285381 0.591468507 1.085680251 0.585254155
[86] -1.289190973 1.744028333 1.049109086 -0.259738987 -1.121070075
[91] 0.112965223 0.149489133 -0.448363589 -0.462442181 -1.762795931
[96] 0.608706071 -0.898905406 0.752459926 -0.293932673 -1.941893470
> rowMin(tmp2)
[1] -0.101402419 -2.514897794 0.714304627 -1.763504333 2.374178331
[6] 0.808981752 0.295789964 0.889882178 0.681121839 1.542968665
[11] -0.454648092 -0.150628662 0.302414780 0.674783672 0.491458225
[16] -0.712048581 0.348810219 -1.122940458 0.398138268 0.289540540
[21] -0.794192941 -1.464171162 -0.645047627 -0.800936361 -1.405002232
[26] -0.553270258 -1.429980555 -0.369223308 -0.250518664 0.164000162
[31] -1.776790509 -0.260800884 0.047329968 -1.551692155 -1.125260190
[36] -0.348988406 -0.017506714 0.843295316 1.272730088 -0.823283129
[41] 0.007041011 2.201899340 1.439474948 0.194915209 0.256414927
[46] 1.380608107 1.942467199 0.030828009 -1.152216885 1.415037524
[51] 0.835204100 0.176128314 -1.708785596 -1.642887695 -0.736204103
[56] 0.325846110 -0.248453744 0.113368766 -1.171958084 -0.634916747
[61] -0.414070883 -0.427350307 -1.208171198 -0.293463596 -0.886541692
[66] -0.241545989 -0.774930819 2.028369308 -2.356229458 0.783847967
[71] -0.736497534 1.606597685 -1.268671030 -0.245116196 -0.248197803
[76] 0.814491097 0.672837815 -2.050700115 -0.956793528 -0.401348109
[81] 0.016502331 2.776285381 0.591468507 1.085680251 0.585254155
[86] -1.289190973 1.744028333 1.049109086 -0.259738987 -1.121070075
[91] 0.112965223 0.149489133 -0.448363589 -0.462442181 -1.762795931
[96] 0.608706071 -0.898905406 0.752459926 -0.293932673 -1.941893470
>
> colMeans(tmp2)
[1] -0.1088307
> colSums(tmp2)
[1] -10.88307
> colVars(tmp2)
[1] 1.171489
> colSd(tmp2)
[1] 1.082354
> colMax(tmp2)
[1] 2.776285
> colMin(tmp2)
[1] -2.514898
> colMedians(tmp2)
[1] -0.2433311
> colRanges(tmp2)
[,1]
[1,] -2.514898
[2,] 2.776285
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.8102893 3.3071250 0.6108552 -3.1849089 1.2115427 2.3807440
[7] 1.6017395 -2.1944322 -1.1154055 -5.2628390
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.2642685
[2,] -0.9411313
[3,] -0.4236838
[4,] 0.4259486
[5,] 1.9426216
>
> rowApply(tmp,sum)
[1] 0.11672467 0.91160636 -8.93400746 0.25925972 1.18207603 -0.15770177
[7] 0.08590499 -0.85944276 4.25404287 -1.31433109
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 9 5 4 2 2 4 2 9 7 3
[2,] 1 6 9 3 10 10 6 10 2 5
[3,] 7 10 1 4 8 5 9 3 6 7
[4,] 3 8 8 7 5 1 4 1 4 9
[5,] 4 1 7 10 3 6 10 5 10 10
[6,] 8 9 10 6 1 2 8 7 9 6
[7,] 2 3 2 9 9 7 3 6 8 8
[8,] 6 4 3 5 4 8 5 8 3 4
[9,] 10 7 6 1 7 9 1 4 5 2
[10,] 5 2 5 8 6 3 7 2 1 1
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -2.5647001 1.9080224 -1.9123444 1.4268981 4.7044412 -0.7869380
[7] 1.3404319 -2.3356234 6.0496194 -1.5231410 -0.5615700 -1.1615277
[13] 5.4609230 0.2770331 -2.9425572 1.0683404 -2.4027692 -2.3144077
[19] 0.1183584 -2.5794519
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.59630031
[2,] -0.78614290
[3,] -0.25586855
[4,] 0.01002651
[5,] 0.06358514
>
> rowApply(tmp,sum)
[1] -1.749108 3.066825 3.377559 -5.370371 1.944134
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 5 10 8 4 7
[2,] 3 12 18 17 13
[3,] 13 3 19 5 4
[4,] 12 13 12 16 10
[5,] 14 16 15 20 18
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.78614290 -0.8785689 0.1100133 0.03605114 0.2608185 -2.2057417
[2,] 0.06358514 0.1500767 -1.3546271 0.20097570 1.1009440 0.1167836
[3,] 0.01002651 1.3256308 1.4066739 0.55023858 0.8782825 1.1011141
[4,] -1.59630031 0.6385865 -0.9503855 0.37567797 1.6285042 -0.1046397
[5,] -0.25586855 0.6722972 -1.1240190 0.26395473 0.8358919 0.3055457
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 2.09723614 0.02475482 1.1851756 -0.7541531 -0.8554956 0.2904254
[2,] -0.60290041 -0.56616727 1.4548216 -0.5303929 1.7424376 0.5400878
[3,] 0.03661150 -1.57803639 0.5018291 1.8835896 0.8287616 -1.1132512
[4,] -0.23633086 0.03894281 -0.4153031 -0.8838615 -1.7339888 -1.6360640
[5,] 0.04581557 -0.25511739 3.3230962 -1.2383231 -0.5432848 0.7572743
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 1.1070798 -0.57100348 -1.1240539 -0.2012738 0.90075599 -0.6516100
[2,] 2.7978249 0.90608772 -0.6266837 -0.7511699 -0.06875905 -1.9402747
[3,] 0.6410021 -1.57772992 0.3157709 0.9141190 -0.11705874 -0.7272228
[4,] 0.1714725 -0.05597581 -0.5532361 0.8263621 -0.84264779 0.2592209
[5,] 0.7435438 1.57565460 -0.9543545 0.2803029 -2.27505957 0.7454789
[,19] [,20]
[1,] 0.9590577 -0.6924331
[2,] -1.7254396 2.1596144
[3,] -1.2217154 -0.6810769
[4,] 1.3784510 -1.6788561
[5,] 0.7280048 -1.6867003
>
>
> 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 : 652 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 : 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.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 2.905761 2.081857 -0.1210745 -1.445745 0.398506 -0.3747646 -0.1838563
col8 col9 col10 col11 col12 col13 col14
row1 -0.1836481 -0.1644672 -1.720415 0.2501001 0.6347289 0.3593407 -1.032366
col15 col16 col17 col18 col19 col20
row1 0.1915954 1.680095 -0.5007298 0.550911 -1.706353 0.264454
> tmp[,"col10"]
col10
row1 -1.7204147
row2 0.5776989
row3 -0.7729723
row4 1.5018745
row5 0.5813358
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 2.9057607 2.08185692 -0.1210745 -1.4457450 0.398506 -0.3747646
row5 -0.4023019 0.01590746 -0.8858550 0.4399755 -0.619460 0.5608711
col7 col8 col9 col10 col11 col12
row1 -0.1838563 -0.1836481 -0.1644672 -1.7204147 0.2501001 0.6347289
row5 0.6443390 0.6484802 -1.8149331 0.5813358 -1.4807143 -0.6759338
col13 col14 col15 col16 col17 col18 col19
row1 0.3593407 -1.032366 0.1915954 1.680095 -0.5007298 0.550911 -1.706353
row5 -0.7061826 1.081975 -0.5288056 -1.324749 -0.8175725 -0.919599 -1.242069
col20
row1 0.2644540
row5 0.5408224
> tmp[,c("col6","col20")]
col6 col20
row1 -0.3747646 0.26445400
row2 0.1692195 0.82114103
row3 -0.2416097 -0.01993911
row4 -1.7798151 -0.06530874
row5 0.5608711 0.54082241
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.3747646 0.2644540
row5 0.5608711 0.5408224
>
>
>
>
> 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.17362 49.10064 49.46342 49.49006 48.84376 104.4434 49.98578 51.62939
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.70589 51.69519 49.27148 49.93274 49.32652 50.88788 50.55407 49.18815
col17 col18 col19 col20
row1 50.11081 50.68991 48.60154 105.8372
> tmp[,"col10"]
col10
row1 51.69519
row2 29.80329
row3 30.61149
row4 30.46459
row5 48.51406
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.17362 49.10064 49.46342 49.49006 48.84376 104.4434 49.98578 51.62939
row5 48.67204 50.14181 51.28153 52.03989 48.99521 105.1804 48.06211 50.81653
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.70589 51.69519 49.27148 49.93274 49.32652 50.88788 50.55407 49.18815
row5 49.78496 48.51406 48.35789 50.26043 49.87801 49.11725 49.57105 49.00550
col17 col18 col19 col20
row1 50.11081 50.68991 48.60154 105.8372
row5 51.26560 49.18095 50.49997 105.1262
> tmp[,c("col6","col20")]
col6 col20
row1 104.44342 105.83718
row2 75.04089 74.41308
row3 76.28679 75.83945
row4 74.48091 75.33365
row5 105.18043 105.12617
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.4434 105.8372
row5 105.1804 105.1262
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.4434 105.8372
row5 105.1804 105.1262
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.64092291
[2,] 1.03028798
[3,] 1.99765605
[4,] 0.07012077
[5,] 0.49208136
> tmp[,c("col17","col7")]
col17 col7
[1,] 1.42742430 0.9224543
[2,] -0.05360787 -0.3357685
[3,] -2.14821699 0.7429014
[4,] -0.74357130 -0.8949622
[5,] 0.04551669 0.2359797
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -1.46129070 1.4431674
[2,] 0.78227692 -0.1629743
[3,] -0.05606876 -0.7315166
[4,] 0.93995710 -1.2294929
[5,] 2.22335505 -1.3960524
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -1.461291
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -1.4612907
[2,] 0.7822769
>
>
>
> 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 -0.4935279 -0.85412101 -0.2800305 -0.1640159 2.0830127 0.774179 1.6560227
row1 1.0775466 0.01540777 0.6434411 -1.2920227 -0.6825622 1.449828 0.6543893
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 0.2670738 0.9193374 0.19248663 -2.4094779 0.08533768 0.8280053 -0.7042917
row1 -1.8048081 0.8513209 0.04084467 0.7480388 0.57947605 1.3672796 -0.1159666
[,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.8848624 -0.002731598 0.9633319 -0.6018490 0.4602281 0.7982929
row1 -0.7070758 1.698261861 0.9142733 0.9926718 -0.8516638 -0.4532327
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.5962353 0.4870199 2.079501 -1.033495 -1.967144 -0.3298167 1.693656
[,8] [,9] [,10]
row2 0.2828302 -0.2203649 0.3919017
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 2.147963 -1.16008 0.1278959 -0.1701347 0.07777734 1.350778 0.1383476
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 1.228659 0.04367791 -1.553421 0.7934862 -0.1540583 -1.081313 -1.14856
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.752685 -1.061847 -1.481198 -0.3964388 0.1088555 0.1620972
>
>
> 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: 0x61b88f5daf80>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f159e2744fb9f"
[2] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f159e1bfdfa26"
[3] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f159e671ba053"
[4] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f159e4a4a0677"
[5] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f159e55ec93cd"
[6] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f159e4c179c1c"
[7] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f159e6282724c"
[8] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f159e11c31966"
[9] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f159e4dbc0cd2"
[10] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f159e262e092a"
[11] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f159e1e11b0ad"
[12] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f159e7584c857"
[13] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f159e1390381d"
[14] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f159e3d7d150c"
[15] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f159e285bde2f"
>
>
> ### 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: 0x61b88f6dd510>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x61b88f6dd510>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x61b88f6dd510>
> rowMedians(tmp)
[1] -0.0246781518 0.1818408434 0.2478029049 0.0914233392 0.2676852967
[6] -0.1139480908 -0.1002999175 -0.0516110634 0.1407869781 -0.0054768756
[11] -0.3809730104 0.3199127991 -0.2865868717 0.2486222873 0.3880357207
[16] -0.4290614145 -0.0457525579 0.1883735085 0.0473622448 0.1563896971
[21] -0.4136960139 0.2646932770 0.4026031491 0.6615354340 0.1572892279
[26] 0.4299157345 -0.5254615137 0.2037514272 0.0006557363 0.2409900380
[31] -0.1123965311 -0.3375332304 -0.2828416021 0.1106403219 0.3668913904
[36] 0.1887691674 -0.1713091686 -0.5823212499 0.3212356403 0.3442993908
[41] 0.2163474393 0.2834077717 -0.4847282876 -0.5815375449 -0.5425007606
[46] 0.2222769508 0.7118425237 0.1046505362 -0.0375827940 -0.2933248779
[51] -0.4424373722 -0.2701783348 0.2942833271 -0.0413485444 -0.2843449458
[56] -0.3481374083 -0.5738280036 -0.1126118252 -0.0180572147 0.3917500694
[61] -0.2720742070 -0.4409856389 -0.1878968066 -0.2281589811 -0.6313044600
[66] -0.3576518071 0.1718932735 0.0337370218 0.3632518677 0.2755448795
[71] -0.1323929026 -0.0861761147 0.5157260864 0.3231625755 0.0982107556
[76] 0.1032069237 0.1950778800 0.2494551794 0.0228306424 0.3860168164
[81] 0.4270314291 0.1532780426 0.3369403488 0.1732629990 -0.2105236752
[86] 0.2909843516 0.0829477559 -0.3008885751 0.3344579351 0.2879350026
[91] 0.0040269840 -0.3331710433 0.6209688531 0.2512679880 0.2487837024
[96] 0.6023509867 -0.2005482147 0.1463378931 -0.3056588886 0.0940582061
[101] -0.1809189790 0.3742925099 0.3355219327 -0.2408386770 -0.5566569573
[106] -0.2594031217 -0.1977147256 0.1099552716 -0.0750605683 0.0534040776
[111] -0.2579290450 0.6392036084 -0.0257199821 -0.1013403144 0.3585031920
[116] 0.1143613655 -0.8524772913 0.1177993924 0.6325117891 0.0099493878
[121] 0.0055603329 -0.3447397177 -0.3562682895 0.1908815613 -0.1662873240
[126] 0.1706475361 0.0139416575 -0.2468671494 -0.3620469829 -0.8432294352
[131] 0.1856992596 0.0009897115 0.1094457333 -0.4139021956 0.0113279062
[136] -0.2622176425 -0.0613170715 0.4262346833 -0.1739721992 -0.1213704068
[141] -0.0102818205 0.0974691110 -0.0666777816 0.1999860899 0.2016853335
[146] 0.0713838628 0.0247462634 -0.1579842073 -0.3077965062 0.2248478532
[151] 0.1314426829 0.2856263852 -0.3002482975 0.2834505145 -0.2031565145
[156] -0.3495295124 0.3718421103 0.1022722029 0.1163469736 -0.2058012375
[161] -0.0309994128 0.0095372217 0.3229895065 0.6205038710 1.0794559838
[166] 0.1990753325 -0.3376018777 -0.0056079972 -0.1738831832 0.1329535343
[171] 0.2399291642 0.1851898347 0.2825470697 -0.2279598124 0.0350420483
[176] -0.4197857702 0.4826365262 0.0712988361 -0.1315699149 0.0788541228
[181] -0.3541367105 -0.0785032254 -0.1087400658 -0.0477358598 0.4370472387
[186] -0.1878858922 0.0936121477 0.2909120541 -0.1150409180 -0.2854228680
[191] 0.1943189347 0.0900384264 0.3584689125 -0.3592750618 0.1667228195
[196] 0.1591375439 0.1526458268 -0.2400606198 0.4574426499 -0.0903920340
[201] -0.0585601800 -0.4816968327 -0.1961268087 -0.1826020755 -0.6475802166
[206] -0.0966463637 -0.1201281299 0.1121012520 -0.2916186140 -0.4319766259
[211] 0.1872921185 0.0646918344 0.0028083845 0.6635121579 0.4755768510
[216] 0.2851876955 0.0271575078 0.5684550829 -0.0961723620 -0.2471136944
[221] -0.1443266154 0.1251023377 0.4429335382 -0.3570054226 -0.0495660437
[226] 0.2950557302 -0.2519889251 -0.4006567964 0.1715237743 0.0846977612
>
> proc.time()
user system elapsed
1.343 0.708 2.040
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: 0x5ab853f48520>
> .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: 0x5ab853f48520>
> .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: 0x5ab853f48520>
> .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: 0x5ab853f48520>
> 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: 0x5ab853af1f60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5ab853af1f60>
> .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: 0x5ab853af1f60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5ab853af1f60>
> .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: 0x5ab853af1f60>
> 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: 0x5ab85469bb40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5ab85469bb40>
> .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: 0x5ab85469bb40>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5ab85469bb40>
> .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: 0x5ab85469bb40>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5ab85469bb40>
> .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: 0x5ab85469bb40>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5ab85469bb40>
> .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: 0x5ab85469bb40>
> 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: 0x5ab8546d8bc0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5ab8546d8bc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5ab8546d8bc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5ab8546d8bc0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3f17df27fca10e" "BufferedMatrixFile3f17df479aed54"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3f17df27fca10e" "BufferedMatrixFile3f17df479aed54"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5ab855a60de0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5ab855a60de0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5ab855a60de0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5ab855a60de0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5ab855a60de0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5ab855a60de0>
> .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: 0x5ab853796f80>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5ab853796f80>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5ab853796f80>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5ab853796f80>
> 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: 0x5ab854731690>
> .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: 0x5ab854731690>
> rm(P)
>
> proc.time()
user system elapsed
0.260 0.035 0.283
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.260 0.048 0.294