| Back to Build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-05-18 11:32 -0400 (Mon, 18 May 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.4 LTS) | x86_64 | 4.6.0 RC (2026-04-17 r89917) -- "Because it was There" | 4995 |
| 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 262/2418 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.76.0 (landing page) Ben Bolstad
| nebbiolo1 | 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.76.0 |
| Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.76.0.tar.gz |
| StartedAt: 2026-05-17 22:05:04 -0400 (Sun, 17 May 2026) |
| EndedAt: 2026-05-17 22:05:30 -0400 (Sun, 17 May 2026) |
| EllapsedTime: 26.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.76.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.23-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-18 02:05:04 UTC
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.76.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.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.23-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.76.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.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
1580 | if (!(Matrix->readonly) & setting){
| ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
3327 | static int sort_double(const double *a1,const double *a2){
| ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.23-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.23-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.23-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R 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.250 0.048 0.285
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.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 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] "Sun May 17 22:05:20 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] "Sun May 17 22:05:20 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: 0x605d43342690>
>
>
>
> 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] "Sun May 17 22:05:20 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] "Sun May 17 22:05:20 2026"
>
> ColMode(tmp2)
<pointer: 0x605d43342690>
>
>
>
> ### 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.1757043 -0.6510277 -0.4279064 2.1455663
[2,] 0.9716347 1.0612374 -0.6981473 -0.8831106
[3,] -0.3608602 0.9351213 -0.4841394 -1.1200872
[4,] 0.6510267 -0.7516250 -1.0589374 -0.5060931
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.1757043 0.6510277 0.4279064 2.1455663
[2,] 0.9716347 1.0612374 0.6981473 0.8831106
[3,] 0.3608602 0.9351213 0.4841394 1.1200872
[4,] 0.6510267 0.7516250 1.0589374 0.5060931
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0087814 0.8068629 0.6541456 1.4647752
[2,] 0.9857153 1.0301638 0.8355521 0.9397396
[3,] 0.6007164 0.9670167 0.6958013 1.0583417
[4,] 0.8068622 0.8669631 1.0290468 0.7114022
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 225.26352 33.71966 31.96936 41.79332
[2,] 35.82879 36.36288 34.05367 35.28051
[3,] 31.36802 35.60529 32.44215 36.70350
[4,] 33.71965 34.42126 36.34941 32.62011
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x605d446f60c0>
> exp(tmp5)
<pointer: 0x605d446f60c0>
> log(tmp5,2)
<pointer: 0x605d446f60c0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.8565
> Min(tmp5)
[1] 53.41688
> mean(tmp5)
[1] 72.20019
> Sum(tmp5)
[1] 14440.04
> Var(tmp5)
[1] 853.9258
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.76140 69.98406 71.00564 71.91993 71.08952 67.40966 70.00906 70.80063
[9] 68.28870 69.73326
> rowSums(tmp5)
[1] 1835.228 1399.681 1420.113 1438.399 1421.790 1348.193 1400.181 1416.013
[9] 1365.774 1394.665
> rowVars(tmp5)
[1] 7929.86369 27.92596 52.37711 38.63763 87.00775 73.89677
[7] 62.39712 57.40227 96.94068 52.68326
> rowSd(tmp5)
[1] 89.049782 5.284502 7.237204 6.215918 9.327794 8.596323 7.899185
[8] 7.576429 9.845846 7.258323
> rowMax(tmp5)
[1] 468.85650 77.03091 80.34346 85.68096 89.65065 88.88384 84.69300
[8] 88.42290 93.13149 81.49601
> rowMin(tmp5)
[1] 61.35794 59.42036 54.68370 57.69332 57.97043 56.73379 57.87989 58.48454
[9] 53.41688 55.99221
>
> colMeans(tmp5)
[1] 107.35459 71.94893 68.65297 72.66992 69.68550 68.89836 69.63882
[8] 66.33959 74.48647 73.56536 70.22784 72.00983 69.95995 71.09702
[15] 70.02920 68.05892 70.45320 65.43430 72.18729 71.30568
> colSums(tmp5)
[1] 1073.5459 719.4893 686.5297 726.6992 696.8550 688.9836 696.3882
[8] 663.3959 744.8647 735.6536 702.2784 720.0983 699.5995 710.9702
[15] 700.2920 680.5892 704.5320 654.3430 721.8729 713.0568
> colVars(tmp5)
[1] 16190.92540 44.33516 29.47164 66.18619 95.45885 44.73611
[7] 62.59449 50.78220 76.36102 63.82373 71.69865 74.49643
[13] 57.37076 96.35628 80.78988 48.13357 48.18552 37.89538
[19] 58.85824 32.14653
> colSd(tmp5)
[1] 127.243567 6.658466 5.428779 8.135490 9.770304 6.688505
[7] 7.911668 7.126163 8.738479 7.988976 8.467506 8.631132
[13] 7.574349 9.816124 8.988319 6.937836 6.941579 6.155923
[19] 7.671912 5.669791
> colMax(tmp5)
[1] 468.85650 81.45522 77.45743 86.98732 85.68096 80.68365 82.64846
[8] 81.49601 87.24258 88.88384 81.50684 89.65065 85.59272 93.13149
[15] 85.01159 77.49774 84.69300 76.61327 88.42290 77.04836
> colMin(tmp5)
[1] 53.41688 56.73379 59.12125 61.56269 57.97043 59.78294 57.38334 57.87989
[9] 59.40618 57.69332 54.68370 61.35794 62.65925 55.99221 55.80998 58.48454
[17] 61.41836 58.67151 61.44231 58.97376
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 91.76140 69.98406 NA 71.91993 71.08952 67.40966 70.00906 70.80063
[9] 68.28870 69.73326
> rowSums(tmp5)
[1] 1835.228 1399.681 NA 1438.399 1421.790 1348.193 1400.181 1416.013
[9] 1365.774 1394.665
> rowVars(tmp5)
[1] 7929.86369 27.92596 53.48628 38.63763 87.00775 73.89677
[7] 62.39712 57.40227 96.94068 52.68326
> rowSd(tmp5)
[1] 89.049782 5.284502 7.313432 6.215918 9.327794 8.596323 7.899185
[8] 7.576429 9.845846 7.258323
> rowMax(tmp5)
[1] 468.85650 77.03091 NA 85.68096 89.65065 88.88384 84.69300
[8] 88.42290 93.13149 81.49601
> rowMin(tmp5)
[1] 61.35794 59.42036 NA 57.69332 57.97043 56.73379 57.87989 58.48454
[9] 53.41688 55.99221
>
> colMeans(tmp5)
[1] 107.35459 71.94893 68.65297 72.66992 69.68550 68.89836 69.63882
[8] 66.33959 74.48647 73.56536 70.22784 72.00983 69.95995 71.09702
[15] 70.02920 68.05892 NA 65.43430 72.18729 71.30568
> colSums(tmp5)
[1] 1073.5459 719.4893 686.5297 726.6992 696.8550 688.9836 696.3882
[8] 663.3959 744.8647 735.6536 702.2784 720.0983 699.5995 710.9702
[15] 700.2920 680.5892 NA 654.3430 721.8729 713.0568
> colVars(tmp5)
[1] 16190.92540 44.33516 29.47164 66.18619 95.45885 44.73611
[7] 62.59449 50.78220 76.36102 63.82373 71.69865 74.49643
[13] 57.37076 96.35628 80.78988 48.13357 NA 37.89538
[19] 58.85824 32.14653
> colSd(tmp5)
[1] 127.243567 6.658466 5.428779 8.135490 9.770304 6.688505
[7] 7.911668 7.126163 8.738479 7.988976 8.467506 8.631132
[13] 7.574349 9.816124 8.988319 6.937836 NA 6.155923
[19] 7.671912 5.669791
> colMax(tmp5)
[1] 468.85650 81.45522 77.45743 86.98732 85.68096 80.68365 82.64846
[8] 81.49601 87.24258 88.88384 81.50684 89.65065 85.59272 93.13149
[15] 85.01159 77.49774 NA 76.61327 88.42290 77.04836
> colMin(tmp5)
[1] 53.41688 56.73379 59.12125 61.56269 57.97043 59.78294 57.38334 57.87989
[9] 59.40618 57.69332 54.68370 61.35794 62.65925 55.99221 55.80998 58.48454
[17] NA 58.67151 61.44231 58.97376
>
> Max(tmp5,na.rm=TRUE)
[1] 468.8565
> Min(tmp5,na.rm=TRUE)
[1] 53.41688
> mean(tmp5,na.rm=TRUE)
[1] 72.1783
> Sum(tmp5,na.rm=TRUE)
[1] 14363.48
> Var(tmp5,na.rm=TRUE)
[1] 858.1423
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.76140 69.98406 70.71358 71.91993 71.08952 67.40966 70.00906 70.80063
[9] 68.28870 69.73326
> rowSums(tmp5,na.rm=TRUE)
[1] 1835.228 1399.681 1343.558 1438.399 1421.790 1348.193 1400.181 1416.013
[9] 1365.774 1394.665
> rowVars(tmp5,na.rm=TRUE)
[1] 7929.86369 27.92596 53.48628 38.63763 87.00775 73.89677
[7] 62.39712 57.40227 96.94068 52.68326
> rowSd(tmp5,na.rm=TRUE)
[1] 89.049782 5.284502 7.313432 6.215918 9.327794 8.596323 7.899185
[8] 7.576429 9.845846 7.258323
> rowMax(tmp5,na.rm=TRUE)
[1] 468.85650 77.03091 80.34346 85.68096 89.65065 88.88384 84.69300
[8] 88.42290 93.13149 81.49601
> rowMin(tmp5,na.rm=TRUE)
[1] 61.35794 59.42036 54.68370 57.69332 57.97043 56.73379 57.87989 58.48454
[9] 53.41688 55.99221
>
> colMeans(tmp5,na.rm=TRUE)
[1] 107.35459 71.94893 68.65297 72.66992 69.68550 68.89836 69.63882
[8] 66.33959 74.48647 73.56536 70.22784 72.00983 69.95995 71.09702
[15] 70.02920 68.05892 69.77526 65.43430 72.18729 71.30568
> colSums(tmp5,na.rm=TRUE)
[1] 1073.5459 719.4893 686.5297 726.6992 696.8550 688.9836 696.3882
[8] 663.3959 744.8647 735.6536 702.2784 720.0983 699.5995 710.9702
[15] 700.2920 680.5892 627.9773 654.3430 721.8729 713.0568
> colVars(tmp5,na.rm=TRUE)
[1] 16190.92540 44.33516 29.47164 66.18619 95.45885 44.73611
[7] 62.59449 50.78220 76.36102 63.82373 71.69865 74.49643
[13] 57.37076 96.35628 80.78988 48.13357 49.03820 37.89538
[19] 58.85824 32.14653
> colSd(tmp5,na.rm=TRUE)
[1] 127.243567 6.658466 5.428779 8.135490 9.770304 6.688505
[7] 7.911668 7.126163 8.738479 7.988976 8.467506 8.631132
[13] 7.574349 9.816124 8.988319 6.937836 7.002728 6.155923
[19] 7.671912 5.669791
> colMax(tmp5,na.rm=TRUE)
[1] 468.85650 81.45522 77.45743 86.98732 85.68096 80.68365 82.64846
[8] 81.49601 87.24258 88.88384 81.50684 89.65065 85.59272 93.13149
[15] 85.01159 77.49774 84.69300 76.61327 88.42290 77.04836
> colMin(tmp5,na.rm=TRUE)
[1] 53.41688 56.73379 59.12125 61.56269 57.97043 59.78294 57.38334 57.87989
[9] 59.40618 57.69332 54.68370 61.35794 62.65925 55.99221 55.80998 58.48454
[17] 61.41836 58.67151 61.44231 58.97376
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.76140 69.98406 NaN 71.91993 71.08952 67.40966 70.00906 70.80063
[9] 68.28870 69.73326
> rowSums(tmp5,na.rm=TRUE)
[1] 1835.228 1399.681 0.000 1438.399 1421.790 1348.193 1400.181 1416.013
[9] 1365.774 1394.665
> rowVars(tmp5,na.rm=TRUE)
[1] 7929.86369 27.92596 NA 38.63763 87.00775 73.89677
[7] 62.39712 57.40227 96.94068 52.68326
> rowSd(tmp5,na.rm=TRUE)
[1] 89.049782 5.284502 NA 6.215918 9.327794 8.596323 7.899185
[8] 7.576429 9.845846 7.258323
> rowMax(tmp5,na.rm=TRUE)
[1] 468.85650 77.03091 NA 85.68096 89.65065 88.88384 84.69300
[8] 88.42290 93.13149 81.49601
> rowMin(tmp5,na.rm=TRUE)
[1] 61.35794 59.42036 NA 57.69332 57.97043 56.73379 57.87989 58.48454
[9] 53.41688 55.99221
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 112.02861 71.70906 68.77840 72.25618 68.50128 69.10083 68.74864
[8] 66.89629 73.93870 73.81832 71.95496 73.02751 69.20140 72.05909
[15] 69.71607 67.01016 NaN 65.33762 71.44178 71.35811
> colSums(tmp5,na.rm=TRUE)
[1] 1008.2574 645.3815 619.0056 650.3056 616.5115 621.9074 618.7377
[8] 602.0666 665.4483 664.3649 647.5947 657.2476 622.8126 648.5318
[15] 627.4447 603.0915 0.0000 588.0385 642.9760 642.2230
> colVars(tmp5,na.rm=TRUE)
[1] 17969.01865 49.22977 32.97861 72.53373 91.61452 49.86693
[7] 61.50392 53.64346 82.53056 71.08179 47.10262 72.15710
[13] 58.06894 97.98810 89.78562 41.77648 NA 42.52714
[19] 59.96290 36.13392
> colSd(tmp5,na.rm=TRUE)
[1] 134.048568 7.016393 5.742700 8.516673 9.571548 7.061652
[7] 7.842444 7.324169 9.084633 8.431002 6.863135 8.494534
[13] 7.620298 9.898894 9.475527 6.463472 NA 6.521284
[19] 7.743571 6.011150
> colMax(tmp5,na.rm=TRUE)
[1] 468.85650 81.45522 77.45743 86.98732 85.68096 80.68365 82.64846
[8] 81.49601 87.24258 88.88384 81.50684 89.65065 85.59272 93.13149
[15] 85.01159 75.62514 -Inf 76.61327 88.42290 77.04836
> colMin(tmp5,na.rm=TRUE)
[1] 53.41688 56.73379 59.12125 61.56269 57.97043 59.78294 57.38334 57.87989
[9] 59.40618 57.69332 60.20109 61.35794 62.65925 55.99221 55.80998 58.48454
[17] Inf 58.67151 61.44231 58.97376
>
>
>
>
> 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] 130.6839 223.4158 194.5173 209.6676 182.1681 229.8221 134.1261 144.0564
[9] 227.0238 192.8265
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 130.6839 223.4158 194.5173 209.6676 182.1681 229.8221 134.1261 144.0564
[9] 227.0238 192.8265
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] 1.421085e-14 1.705303e-13 1.421085e-14 0.000000e+00 -2.842171e-14
[6] 8.526513e-14 2.842171e-14 -8.526513e-14 -1.136868e-13 1.136868e-13
[11] -1.136868e-13 2.842171e-13 5.684342e-14 5.684342e-14 -5.684342e-14
[16] -2.842171e-14 5.684342e-14 0.000000e+00 -5.684342e-14 2.842171e-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)
+ }
8 12
8 18
2 4
4 5
1 19
4 2
7 6
6 6
7 7
7 11
9 11
2 10
7 8
10 14
7 19
9 14
10 6
1 9
1 20
6 15
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 2.107715
> Min(tmp)
[1] -2.247604
> mean(tmp)
[1] 0.1021272
> Sum(tmp)
[1] 10.21272
> Var(tmp)
[1] 0.9723873
>
> rowMeans(tmp)
[1] 0.1021272
> rowSums(tmp)
[1] 10.21272
> rowVars(tmp)
[1] 0.9723873
> rowSd(tmp)
[1] 0.986097
> rowMax(tmp)
[1] 2.107715
> rowMin(tmp)
[1] -2.247604
>
> colMeans(tmp)
[1] -1.77074019 0.67707058 -0.63256824 0.63105828 0.56813343 0.09073843
[7] -0.68339065 0.88230905 -0.24347875 -0.19257954 -0.95321345 1.56286152
[13] 1.32258658 1.87727525 -0.77914952 0.85641791 -0.45669935 1.32292609
[19] -0.02211196 -1.32058380 0.17399512 -0.10214610 1.21114339 0.79743326
[25] -0.96742905 0.16102387 -0.25762369 -0.65393167 1.02737976 -0.95558306
[31] -0.73508743 -1.88952594 0.28061258 1.61299130 0.42573027 0.28200184
[37] 1.69394325 -1.01721760 1.43141830 -2.24760412 0.14382290 1.47781095
[43] 1.95348474 -0.61443140 -0.36205580 0.10762381 -1.02262439 -0.76394298
[49] -0.21052378 -1.24264698 1.17155288 -0.27661020 -0.39863074 -1.08639269
[55] 1.41646362 0.81198826 -1.31375279 0.82686968 0.99028567 0.91932550
[61] -0.65065413 1.66780133 -0.97402910 0.59241658 -0.28265894 0.23582641
[67] 0.21075848 -1.53971661 -0.44979201 1.06245767 0.11600320 -0.53644866
[73] -2.10069194 2.10771479 0.83440361 -0.87809857 1.40333393 -0.15827358
[79] 0.03213331 0.67667404 0.14773666 -0.64791753 0.90576042 -0.37482436
[85] 1.29047843 0.54298793 -1.76909374 1.53908935 -0.29093287 0.47140650
[91] -0.54105284 -0.44092654 0.76413026 0.72019927 -0.89597071 0.50799871
[97] 0.34478733 -0.24241169 0.97640862 0.29970324
> colSums(tmp)
[1] -1.77074019 0.67707058 -0.63256824 0.63105828 0.56813343 0.09073843
[7] -0.68339065 0.88230905 -0.24347875 -0.19257954 -0.95321345 1.56286152
[13] 1.32258658 1.87727525 -0.77914952 0.85641791 -0.45669935 1.32292609
[19] -0.02211196 -1.32058380 0.17399512 -0.10214610 1.21114339 0.79743326
[25] -0.96742905 0.16102387 -0.25762369 -0.65393167 1.02737976 -0.95558306
[31] -0.73508743 -1.88952594 0.28061258 1.61299130 0.42573027 0.28200184
[37] 1.69394325 -1.01721760 1.43141830 -2.24760412 0.14382290 1.47781095
[43] 1.95348474 -0.61443140 -0.36205580 0.10762381 -1.02262439 -0.76394298
[49] -0.21052378 -1.24264698 1.17155288 -0.27661020 -0.39863074 -1.08639269
[55] 1.41646362 0.81198826 -1.31375279 0.82686968 0.99028567 0.91932550
[61] -0.65065413 1.66780133 -0.97402910 0.59241658 -0.28265894 0.23582641
[67] 0.21075848 -1.53971661 -0.44979201 1.06245767 0.11600320 -0.53644866
[73] -2.10069194 2.10771479 0.83440361 -0.87809857 1.40333393 -0.15827358
[79] 0.03213331 0.67667404 0.14773666 -0.64791753 0.90576042 -0.37482436
[85] 1.29047843 0.54298793 -1.76909374 1.53908935 -0.29093287 0.47140650
[91] -0.54105284 -0.44092654 0.76413026 0.72019927 -0.89597071 0.50799871
[97] 0.34478733 -0.24241169 0.97640862 0.29970324
> 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.77074019 0.67707058 -0.63256824 0.63105828 0.56813343 0.09073843
[7] -0.68339065 0.88230905 -0.24347875 -0.19257954 -0.95321345 1.56286152
[13] 1.32258658 1.87727525 -0.77914952 0.85641791 -0.45669935 1.32292609
[19] -0.02211196 -1.32058380 0.17399512 -0.10214610 1.21114339 0.79743326
[25] -0.96742905 0.16102387 -0.25762369 -0.65393167 1.02737976 -0.95558306
[31] -0.73508743 -1.88952594 0.28061258 1.61299130 0.42573027 0.28200184
[37] 1.69394325 -1.01721760 1.43141830 -2.24760412 0.14382290 1.47781095
[43] 1.95348474 -0.61443140 -0.36205580 0.10762381 -1.02262439 -0.76394298
[49] -0.21052378 -1.24264698 1.17155288 -0.27661020 -0.39863074 -1.08639269
[55] 1.41646362 0.81198826 -1.31375279 0.82686968 0.99028567 0.91932550
[61] -0.65065413 1.66780133 -0.97402910 0.59241658 -0.28265894 0.23582641
[67] 0.21075848 -1.53971661 -0.44979201 1.06245767 0.11600320 -0.53644866
[73] -2.10069194 2.10771479 0.83440361 -0.87809857 1.40333393 -0.15827358
[79] 0.03213331 0.67667404 0.14773666 -0.64791753 0.90576042 -0.37482436
[85] 1.29047843 0.54298793 -1.76909374 1.53908935 -0.29093287 0.47140650
[91] -0.54105284 -0.44092654 0.76413026 0.72019927 -0.89597071 0.50799871
[97] 0.34478733 -0.24241169 0.97640862 0.29970324
> colMin(tmp)
[1] -1.77074019 0.67707058 -0.63256824 0.63105828 0.56813343 0.09073843
[7] -0.68339065 0.88230905 -0.24347875 -0.19257954 -0.95321345 1.56286152
[13] 1.32258658 1.87727525 -0.77914952 0.85641791 -0.45669935 1.32292609
[19] -0.02211196 -1.32058380 0.17399512 -0.10214610 1.21114339 0.79743326
[25] -0.96742905 0.16102387 -0.25762369 -0.65393167 1.02737976 -0.95558306
[31] -0.73508743 -1.88952594 0.28061258 1.61299130 0.42573027 0.28200184
[37] 1.69394325 -1.01721760 1.43141830 -2.24760412 0.14382290 1.47781095
[43] 1.95348474 -0.61443140 -0.36205580 0.10762381 -1.02262439 -0.76394298
[49] -0.21052378 -1.24264698 1.17155288 -0.27661020 -0.39863074 -1.08639269
[55] 1.41646362 0.81198826 -1.31375279 0.82686968 0.99028567 0.91932550
[61] -0.65065413 1.66780133 -0.97402910 0.59241658 -0.28265894 0.23582641
[67] 0.21075848 -1.53971661 -0.44979201 1.06245767 0.11600320 -0.53644866
[73] -2.10069194 2.10771479 0.83440361 -0.87809857 1.40333393 -0.15827358
[79] 0.03213331 0.67667404 0.14773666 -0.64791753 0.90576042 -0.37482436
[85] 1.29047843 0.54298793 -1.76909374 1.53908935 -0.29093287 0.47140650
[91] -0.54105284 -0.44092654 0.76413026 0.72019927 -0.89597071 0.50799871
[97] 0.34478733 -0.24241169 0.97640862 0.29970324
> colMedians(tmp)
[1] -1.77074019 0.67707058 -0.63256824 0.63105828 0.56813343 0.09073843
[7] -0.68339065 0.88230905 -0.24347875 -0.19257954 -0.95321345 1.56286152
[13] 1.32258658 1.87727525 -0.77914952 0.85641791 -0.45669935 1.32292609
[19] -0.02211196 -1.32058380 0.17399512 -0.10214610 1.21114339 0.79743326
[25] -0.96742905 0.16102387 -0.25762369 -0.65393167 1.02737976 -0.95558306
[31] -0.73508743 -1.88952594 0.28061258 1.61299130 0.42573027 0.28200184
[37] 1.69394325 -1.01721760 1.43141830 -2.24760412 0.14382290 1.47781095
[43] 1.95348474 -0.61443140 -0.36205580 0.10762381 -1.02262439 -0.76394298
[49] -0.21052378 -1.24264698 1.17155288 -0.27661020 -0.39863074 -1.08639269
[55] 1.41646362 0.81198826 -1.31375279 0.82686968 0.99028567 0.91932550
[61] -0.65065413 1.66780133 -0.97402910 0.59241658 -0.28265894 0.23582641
[67] 0.21075848 -1.53971661 -0.44979201 1.06245767 0.11600320 -0.53644866
[73] -2.10069194 2.10771479 0.83440361 -0.87809857 1.40333393 -0.15827358
[79] 0.03213331 0.67667404 0.14773666 -0.64791753 0.90576042 -0.37482436
[85] 1.29047843 0.54298793 -1.76909374 1.53908935 -0.29093287 0.47140650
[91] -0.54105284 -0.44092654 0.76413026 0.72019927 -0.89597071 0.50799871
[97] 0.34478733 -0.24241169 0.97640862 0.29970324
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -1.77074 0.6770706 -0.6325682 0.6310583 0.5681334 0.09073843 -0.6833907
[2,] -1.77074 0.6770706 -0.6325682 0.6310583 0.5681334 0.09073843 -0.6833907
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.8823091 -0.2434787 -0.1925795 -0.9532134 1.562862 1.322587 1.877275
[2,] 0.8823091 -0.2434787 -0.1925795 -0.9532134 1.562862 1.322587 1.877275
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.7791495 0.8564179 -0.4566993 1.322926 -0.02211196 -1.320584 0.1739951
[2,] -0.7791495 0.8564179 -0.4566993 1.322926 -0.02211196 -1.320584 0.1739951
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.1021461 1.211143 0.7974333 -0.9674291 0.1610239 -0.2576237 -0.6539317
[2,] -0.1021461 1.211143 0.7974333 -0.9674291 0.1610239 -0.2576237 -0.6539317
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 1.02738 -0.9555831 -0.7350874 -1.889526 0.2806126 1.612991 0.4257303
[2,] 1.02738 -0.9555831 -0.7350874 -1.889526 0.2806126 1.612991 0.4257303
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.2820018 1.693943 -1.017218 1.431418 -2.247604 0.1438229 1.477811
[2,] 0.2820018 1.693943 -1.017218 1.431418 -2.247604 0.1438229 1.477811
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 1.953485 -0.6144314 -0.3620558 0.1076238 -1.022624 -0.763943 -0.2105238
[2,] 1.953485 -0.6144314 -0.3620558 0.1076238 -1.022624 -0.763943 -0.2105238
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -1.242647 1.171553 -0.2766102 -0.3986307 -1.086393 1.416464 0.8119883
[2,] -1.242647 1.171553 -0.2766102 -0.3986307 -1.086393 1.416464 0.8119883
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -1.313753 0.8268697 0.9902857 0.9193255 -0.6506541 1.667801 -0.9740291
[2,] -1.313753 0.8268697 0.9902857 0.9193255 -0.6506541 1.667801 -0.9740291
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.5924166 -0.2826589 0.2358264 0.2107585 -1.539717 -0.449792 1.062458
[2,] 0.5924166 -0.2826589 0.2358264 0.2107585 -1.539717 -0.449792 1.062458
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.1160032 -0.5364487 -2.100692 2.107715 0.8344036 -0.8780986 1.403334
[2,] 0.1160032 -0.5364487 -2.100692 2.107715 0.8344036 -0.8780986 1.403334
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.1582736 0.03213331 0.676674 0.1477367 -0.6479175 0.9057604 -0.3748244
[2,] -0.1582736 0.03213331 0.676674 0.1477367 -0.6479175 0.9057604 -0.3748244
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 1.290478 0.5429879 -1.769094 1.539089 -0.2909329 0.4714065 -0.5410528
[2,] 1.290478 0.5429879 -1.769094 1.539089 -0.2909329 0.4714065 -0.5410528
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.4409265 0.7641303 0.7201993 -0.8959707 0.5079987 0.3447873 -0.2424117
[2,] -0.4409265 0.7641303 0.7201993 -0.8959707 0.5079987 0.3447873 -0.2424117
[,99] [,100]
[1,] 0.9764086 0.2997032
[2,] 0.9764086 0.2997032
>
>
> Max(tmp2)
[1] 2.527899
> Min(tmp2)
[1] -2.379408
> mean(tmp2)
[1] -0.1214625
> Sum(tmp2)
[1] -12.14625
> Var(tmp2)
[1] 0.8591171
>
> rowMeans(tmp2)
[1] -0.30803303 0.50262155 1.05464337 0.23102450 -0.82930143 0.12968148
[7] -0.26410217 0.69752749 0.05157396 -1.25520536 0.58033493 -0.17156659
[13] 0.34626098 0.71203411 1.05590564 0.17044184 -0.15941818 0.61025823
[19] -1.40030769 -1.18447709 -0.95697976 0.86976055 -0.03249710 0.99945009
[25] -1.27524679 -0.25403434 0.76684432 1.66592396 0.59420917 -0.86640977
[31] -0.10864109 -1.15422308 -2.32347698 -1.61659858 0.36031759 -1.04538646
[37] -0.86178074 0.17571159 -0.45245500 -0.68843663 0.89558958 0.14062382
[43] -0.53160794 -1.21003675 2.52789851 -0.26996510 -0.43158318 -0.36601259
[49] 0.59413573 -1.12462151 2.00609104 -1.28745279 -0.01728349 -0.09307413
[55] -0.35127250 0.31441563 -0.86844259 0.78312823 -0.70546808 1.03881116
[61] 0.67062006 0.34153998 -0.21375218 -0.89123576 -0.17687265 -0.54181353
[67] 0.34937037 0.03178010 0.72133141 -0.54184418 0.49541827 0.53596998
[73] -1.60304001 0.87426545 -1.82165565 0.48643691 0.55008548 -1.25521191
[79] -1.01527664 -1.09609230 1.04279749 -1.36334780 -0.14381422 0.64771597
[85] -0.95712534 -0.81997612 0.59571763 0.59304101 -0.61385705 -1.09300745
[91] 0.70955903 0.79332739 -0.11318304 -1.85849638 0.19873100 -2.37940800
[97] 0.40665358 -0.36769754 1.80198368 -0.53571194
> rowSums(tmp2)
[1] -0.30803303 0.50262155 1.05464337 0.23102450 -0.82930143 0.12968148
[7] -0.26410217 0.69752749 0.05157396 -1.25520536 0.58033493 -0.17156659
[13] 0.34626098 0.71203411 1.05590564 0.17044184 -0.15941818 0.61025823
[19] -1.40030769 -1.18447709 -0.95697976 0.86976055 -0.03249710 0.99945009
[25] -1.27524679 -0.25403434 0.76684432 1.66592396 0.59420917 -0.86640977
[31] -0.10864109 -1.15422308 -2.32347698 -1.61659858 0.36031759 -1.04538646
[37] -0.86178074 0.17571159 -0.45245500 -0.68843663 0.89558958 0.14062382
[43] -0.53160794 -1.21003675 2.52789851 -0.26996510 -0.43158318 -0.36601259
[49] 0.59413573 -1.12462151 2.00609104 -1.28745279 -0.01728349 -0.09307413
[55] -0.35127250 0.31441563 -0.86844259 0.78312823 -0.70546808 1.03881116
[61] 0.67062006 0.34153998 -0.21375218 -0.89123576 -0.17687265 -0.54181353
[67] 0.34937037 0.03178010 0.72133141 -0.54184418 0.49541827 0.53596998
[73] -1.60304001 0.87426545 -1.82165565 0.48643691 0.55008548 -1.25521191
[79] -1.01527664 -1.09609230 1.04279749 -1.36334780 -0.14381422 0.64771597
[85] -0.95712534 -0.81997612 0.59571763 0.59304101 -0.61385705 -1.09300745
[91] 0.70955903 0.79332739 -0.11318304 -1.85849638 0.19873100 -2.37940800
[97] 0.40665358 -0.36769754 1.80198368 -0.53571194
> 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.30803303 0.50262155 1.05464337 0.23102450 -0.82930143 0.12968148
[7] -0.26410217 0.69752749 0.05157396 -1.25520536 0.58033493 -0.17156659
[13] 0.34626098 0.71203411 1.05590564 0.17044184 -0.15941818 0.61025823
[19] -1.40030769 -1.18447709 -0.95697976 0.86976055 -0.03249710 0.99945009
[25] -1.27524679 -0.25403434 0.76684432 1.66592396 0.59420917 -0.86640977
[31] -0.10864109 -1.15422308 -2.32347698 -1.61659858 0.36031759 -1.04538646
[37] -0.86178074 0.17571159 -0.45245500 -0.68843663 0.89558958 0.14062382
[43] -0.53160794 -1.21003675 2.52789851 -0.26996510 -0.43158318 -0.36601259
[49] 0.59413573 -1.12462151 2.00609104 -1.28745279 -0.01728349 -0.09307413
[55] -0.35127250 0.31441563 -0.86844259 0.78312823 -0.70546808 1.03881116
[61] 0.67062006 0.34153998 -0.21375218 -0.89123576 -0.17687265 -0.54181353
[67] 0.34937037 0.03178010 0.72133141 -0.54184418 0.49541827 0.53596998
[73] -1.60304001 0.87426545 -1.82165565 0.48643691 0.55008548 -1.25521191
[79] -1.01527664 -1.09609230 1.04279749 -1.36334780 -0.14381422 0.64771597
[85] -0.95712534 -0.81997612 0.59571763 0.59304101 -0.61385705 -1.09300745
[91] 0.70955903 0.79332739 -0.11318304 -1.85849638 0.19873100 -2.37940800
[97] 0.40665358 -0.36769754 1.80198368 -0.53571194
> rowMin(tmp2)
[1] -0.30803303 0.50262155 1.05464337 0.23102450 -0.82930143 0.12968148
[7] -0.26410217 0.69752749 0.05157396 -1.25520536 0.58033493 -0.17156659
[13] 0.34626098 0.71203411 1.05590564 0.17044184 -0.15941818 0.61025823
[19] -1.40030769 -1.18447709 -0.95697976 0.86976055 -0.03249710 0.99945009
[25] -1.27524679 -0.25403434 0.76684432 1.66592396 0.59420917 -0.86640977
[31] -0.10864109 -1.15422308 -2.32347698 -1.61659858 0.36031759 -1.04538646
[37] -0.86178074 0.17571159 -0.45245500 -0.68843663 0.89558958 0.14062382
[43] -0.53160794 -1.21003675 2.52789851 -0.26996510 -0.43158318 -0.36601259
[49] 0.59413573 -1.12462151 2.00609104 -1.28745279 -0.01728349 -0.09307413
[55] -0.35127250 0.31441563 -0.86844259 0.78312823 -0.70546808 1.03881116
[61] 0.67062006 0.34153998 -0.21375218 -0.89123576 -0.17687265 -0.54181353
[67] 0.34937037 0.03178010 0.72133141 -0.54184418 0.49541827 0.53596998
[73] -1.60304001 0.87426545 -1.82165565 0.48643691 0.55008548 -1.25521191
[79] -1.01527664 -1.09609230 1.04279749 -1.36334780 -0.14381422 0.64771597
[85] -0.95712534 -0.81997612 0.59571763 0.59304101 -0.61385705 -1.09300745
[91] 0.70955903 0.79332739 -0.11318304 -1.85849638 0.19873100 -2.37940800
[97] 0.40665358 -0.36769754 1.80198368 -0.53571194
>
> colMeans(tmp2)
[1] -0.1214625
> colSums(tmp2)
[1] -12.14625
> colVars(tmp2)
[1] 0.8591171
> colSd(tmp2)
[1] 0.9268857
> colMax(tmp2)
[1] 2.527899
> colMin(tmp2)
[1] -2.379408
> colMedians(tmp2)
[1] -0.1109121
> colRanges(tmp2)
[,1]
[1,] -2.379408
[2,] 2.527899
>
> 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] -3.328246 5.699265 3.266393 2.237152 1.141713 2.317053 -3.472671
[8] -1.446857 2.494722 -1.086239
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.60689953
[2,] -0.92075461
[3,] -0.64705845
[4,] 0.01427985
[5,] 1.37672012
>
> rowApply(tmp,sum)
[1] 4.7491399 1.6666055 2.7804000 3.3533490 -3.5142825 1.5189815
[7] 0.5428647 -2.6281180 0.9895044 -1.6361585
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 4 2 2 9 1 10 3 4 3 3
[2,] 9 8 8 10 10 6 4 3 10 2
[3,] 2 1 10 4 7 9 2 10 8 7
[4,] 8 6 7 6 8 2 10 5 9 1
[5,] 10 4 5 5 2 4 7 9 5 9
[6,] 3 7 4 2 6 7 8 7 1 10
[7,] 5 5 1 8 5 1 6 6 2 6
[8,] 7 9 6 3 3 8 1 2 4 4
[9,] 6 10 9 1 4 3 9 1 6 8
[10,] 1 3 3 7 9 5 5 8 7 5
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 1.7499372 -1.1327381 -1.9179555 3.2317321 -1.4637540 -2.4552237
[7] 0.3109704 -1.0171533 1.4875364 -0.1727982 -0.4381092 1.0583516
[13] -1.4225440 -2.6243013 1.3128252 3.3290266 -1.1461637 0.5337190
[19] -0.8589543 0.5711674
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.2868953
[2,] 0.4355322
[3,] 0.6221195
[4,] 0.7450381
[5,] 1.2341426
>
> rowApply(tmp,sum)
[1] 2.169624 3.841892 -1.247412 -7.168555 1.340021
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 1 19 16 15 15
[2,] 14 12 14 2 3
[3,] 13 1 18 4 4
[4,] 20 16 9 19 14
[5,] 7 3 11 17 2
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -1.2868953 0.5493498 0.5045781 1.5403411 -0.338572760 0.4585315
[2,] 1.2341426 0.3359024 -1.0343031 0.6053378 -0.711356963 0.1472494
[3,] 0.7450381 0.5183834 0.8940657 -0.2912845 -0.002990605 0.8283127
[4,] 0.4355322 -1.7150830 -1.5554998 0.9294400 0.476737160 -3.3741431
[5,] 0.6221195 -0.8212907 -0.7267964 0.4478977 -0.887570857 -0.5151742
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.2769695 -0.62961417 0.9224839 -1.2063022 0.6610331 1.1012411
[2,] 0.9029120 0.05750232 2.2285233 0.1762947 -0.3388822 0.3434967
[3,] -0.8155419 0.11826226 -1.5527648 0.2240313 -1.0931172 -0.3247384
[4,] 1.0068816 0.07466757 0.4414069 -0.2827906 -0.9937576 -0.3514036
[5,] -0.5063118 -0.63797128 -0.5521128 0.9159687 1.3266147 0.2897558
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.4566149 0.1401474 1.4123393 -0.03775494 -0.01633101 -0.5528252
[2,] -0.2515981 -0.7508608 -0.6195629 0.52220751 -0.13607061 0.3873699
[3,] -0.6253916 -1.2534103 -0.1394203 0.94545890 -0.33420332 0.5963779
[4,] 0.2285708 0.3748385 -0.1866011 -0.09756231 -1.07938539 0.6394677
[5,] -0.3175102 -1.1350161 0.8460702 1.99667740 0.41982667 -0.5366713
[,19] [,20]
[1,] -1.0542645 0.7357227
[2,] 0.6320746 0.1115139
[3,] 1.0544400 -0.7389190
[4,] -1.6236652 -0.5162060
[5,] 0.1324608 0.9790558
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 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.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 -0.6822804 -1.077354 1.250222 2.12526 0.6684819 -0.6291671 1.22573
col8 col9 col10 col11 col12 col13 col14
row1 -2.864459 -0.6212597 0.9564687 -0.5911213 0.5055707 0.07305016 -1.159661
col15 col16 col17 col18 col19 col20
row1 1.272525 1.009467 0.5865208 0.2173658 1.309422 -1.911048
> tmp[,"col10"]
col10
row1 0.9564687
row2 0.2291200
row3 -0.7866315
row4 -0.1739068
row5 -0.9338511
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -0.6822804 -1.0773540 1.2502217 2.12526 0.6684819 -0.6291671 1.2257298
row5 1.7109476 0.2814876 -0.3080742 1.02944 -0.5407753 -0.1875780 0.9433837
col8 col9 col10 col11 col12 col13
row1 -2.8644592 -0.6212597 0.9564687 -0.5911213 0.5055707 0.07305016
row5 -0.4065564 0.4280790 -0.9338511 1.2155953 -0.3913043 -0.14803434
col14 col15 col16 col17 col18 col19 col20
row1 -1.1596613 1.272525 1.0094669 0.5865208 0.2173658 1.3094219 -1.911048
row5 0.4708845 2.205412 0.5046305 0.6708333 -0.6364021 0.8994887 -1.237462
> tmp[,c("col6","col20")]
col6 col20
row1 -0.62916707 -1.9110477
row2 -0.04222667 1.2845775
row3 0.80568184 0.5566338
row4 -0.20413171 -0.1983807
row5 -0.18757804 -1.2374615
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.6291671 -1.911048
row5 -0.1875780 -1.237462
>
>
>
>
> 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.62644 51.05721 48.70371 50.98592 50.27372 105.4169 49.47164 49.57108
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.63305 49.4471 49.48531 51.24596 50.69807 50.26121 49.92642 49.93934
col17 col18 col19 col20
row1 49.09955 50.96154 49.00505 105.5036
> tmp[,"col10"]
col10
row1 49.44710
row2 29.46878
row3 28.68655
row4 28.19078
row5 49.84076
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.62644 51.05721 48.70371 50.98592 50.27372 105.4169 49.47164 49.57108
row5 49.18275 48.60492 51.14525 50.80969 49.40374 104.5022 48.97606 47.39923
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.63305 49.44710 49.48531 51.24596 50.69807 50.26121 49.92642 49.93934
row5 47.76094 49.84076 48.52643 49.34174 49.80948 49.77221 50.95195 49.51169
col17 col18 col19 col20
row1 49.09955 50.96154 49.00505 105.5036
row5 50.76288 50.52080 48.32348 105.0713
> tmp[,c("col6","col20")]
col6 col20
row1 105.41693 105.50356
row2 75.89069 76.34146
row3 74.13264 74.58101
row4 73.85996 76.02979
row5 104.50221 105.07134
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.4169 105.5036
row5 104.5022 105.0713
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.4169 105.5036
row5 104.5022 105.0713
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.1737834
[2,] -1.0705698
[3,] 0.9497474
[4,] 0.6255066
[5,] -1.1681968
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.9985075 -0.5349793
[2,] -0.8365234 0.5268160
[3,] 1.8098902 0.7068420
[4,] 0.8094757 -0.7036975
[5,] 0.7996911 -0.1330364
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.3480998 -0.3606999
[2,] -0.3912995 -0.5734515
[3,] -0.3171493 -0.2549341
[4,] -0.2919206 0.8229338
[5,] -0.1606659 -1.7534905
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.3480998
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.3480998
[2,] -0.3912995
>
>
>
> 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.41696210 -1.9666460 -1.403005 0.5515480 -0.5045474 0.1297104 0.3113149
row1 0.05859364 -0.8121738 -1.650607 -0.8438759 2.2101876 1.1247933 0.1591372
[,8] [,9] [,10] [,11] [,12] [,13]
row3 -0.3502073 1.467653 -0.3312577 0.6169984 -0.7466959 0.5119589
row1 -0.8688782 -1.369870 0.1706033 -1.4768242 -1.2050008 -1.2147642
[,14] [,15] [,16] [,17] [,18] [,19]
row3 -0.530529337 0.68396303 0.5874577 -1.0280041 -0.2022702 0.5380450
row1 0.005159319 -0.05880606 -1.2898399 0.1487739 -1.4437072 -0.4358437
[,20]
row3 -1.363854
row1 -1.246953
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -1.590982 0.8818003 0.02480098 1.013948 -0.2710298 0.6232255 -0.1592104
[,8] [,9] [,10]
row2 1.249296 -0.8453322 1.656675
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
row5 1.261876 -0.492859 1.806573 1.311282 0.4551826 1.040668 0.178804 0.7860777
[,9] [,10] [,11] [,12] [,13] [,14] [,15]
row5 0.5257176 -0.9632785 -0.3027646 0.3085636 1.791843 -0.7632334 0.02603728
[,16] [,17] [,18] [,19] [,20]
row5 -0.06472106 -0.1198369 0.2401351 0.1772734 -0.2257841
>
>
> 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: 0x605d44665ed0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ce9d96a1c01f5"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ce9d96fcab0a3"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ce9d961df3441"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ce9d965fe0cf6"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ce9d94258b8f5"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ce9d963091ff1"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ce9d913e8bc2e"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ce9d930c48df2"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ce9d94de3e897"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ce9d96e06bd65"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ce9d95f7cdfba"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ce9d9474c1ce7"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ce9d961f27b04"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ce9d96c0d2062"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2ce9d928591e34"
>
>
> ### 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: 0x605d44547660>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x605d44547660>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x605d44547660>
> rowMedians(tmp)
[1] -0.0694181424 0.7385028132 0.0700051170 0.0257108313 -0.0182873802
[6] 0.2894715085 0.2969742727 0.0642278071 -0.5247843799 -0.2518651965
[11] 0.1586508120 -0.1288574935 -0.2494568346 0.3453486676 0.1986035582
[16] 0.1200386297 -0.5256042983 0.0199917811 -0.4498252060 -0.2860039405
[21] -0.0578708049 -0.0832649684 -0.4779712075 0.1713958917 0.1293204222
[26] 0.2200418349 -0.2461796004 -0.1232032295 0.2249851490 0.4082247155
[31] -0.4579074314 0.0040805266 0.0976906340 -0.3777734055 0.1435133256
[36] 0.0921430585 -0.1374270950 -0.2691976090 -0.1072464325 -0.1218843205
[41] 0.0727324760 0.2037995916 -0.3412596249 0.0916093931 -0.0530702958
[46] 0.0294647255 -0.0761710722 -0.3533926285 0.2294179149 -0.1111590619
[51] -0.2014568880 -0.3042003373 -0.4041336357 -0.5127518022 -0.3447828514
[56] -0.0294836205 0.3148535154 0.6022318557 0.3608381901 0.7011301643
[61] 0.1779699534 0.5108461802 0.1459167425 -0.0659311492 -0.1058512140
[66] -0.3642829370 -0.1053650890 0.0063685505 0.2167657886 0.0498240485
[71] -0.0611970843 -0.0079276570 -0.3378762209 -0.3063177883 -0.4933040558
[76] 0.2144765925 0.0662809516 0.2864258471 -0.1123050417 -0.1400050295
[81] -0.0241408558 0.6454019353 -0.2643158683 0.6757346027 -0.6450746546
[86] 0.2864138427 -0.4996123290 -0.4194623812 0.3459709127 0.1452000376
[91] 0.3560923565 -0.0340943358 -0.3378948467 -0.1527010359 0.3673207643
[96] 0.0127103012 0.1112201346 -0.2491407830 -0.2150692748 0.1528456071
[101] -0.1763858437 -0.0632085895 -0.2869609611 0.3099131043 0.1068100007
[106] 0.1035061687 0.1446137102 -0.3033135179 -0.0048579143 0.1549659458
[111] 0.1050347089 -0.2494801828 -0.6910709651 -0.3057308039 -0.1244956434
[116] -0.7446873510 0.9126994538 0.0121320582 -0.4170573379 0.6428230139
[121] -0.1141787219 0.2503695234 0.2201461122 -0.2797116735 0.1069547124
[126] -0.1330376616 -0.1369104123 0.0415963689 -0.3454091190 -0.1524800959
[131] -0.0283300206 -0.4819289451 -0.2681199317 0.2276499620 0.4476235810
[136] 0.1209635378 0.3291819529 0.1449005349 -0.4850457876 -0.2804359053
[141] -0.5113947256 -0.0446680756 0.3334819751 -0.5222485517 -0.5504276723
[146] 0.1723176768 -0.4495977041 -0.3239210695 0.2365520638 -0.2248847994
[151] 0.0527969005 0.0721169458 0.3529980464 -0.7490073765 -0.2370122104
[156] 0.2926467016 0.1432249432 0.2521192694 -0.4382294541 -0.0830409192
[161] 0.3814128159 -0.4044902917 -0.7006803801 -0.3256893643 -0.4439080344
[166] 0.0082054757 -0.1421985740 0.3497245441 -0.0238850664 0.3050372882
[171] -0.2234268916 -0.1956409407 -0.0568624678 0.1741599197 0.3270535958
[176] 0.0732515809 -0.1234990128 -0.5202357331 0.7329321530 0.4057064386
[181] -0.1379759152 -0.2187183981 -0.5059148039 -0.3861686231 -0.0101224790
[186] 0.4373901904 -0.2916731444 0.1549109631 0.3633984848 0.0213232404
[191] 0.3908227757 -0.0524543974 -0.0138029595 0.1242440295 -0.3828084181
[196] -0.1089437142 -0.2102221708 -0.0013089433 0.3822220186 -0.5959210214
[201] 0.4296980041 0.1069934796 -0.2433352295 0.0007506902 0.3628692461
[206] -0.0703325412 0.4087763940 0.0518964421 0.8685605158 0.1503555626
[211] 0.1566483006 -0.3761425168 0.4094274996 -0.4361689452 0.4292254941
[216] -0.4154939791 0.0876744583 -0.1883494791 -0.5157306068 0.1364374908
[221] 0.2829477650 -0.3829517362 -0.2844650396 -0.3187255291 -0.4350922560
[226] -0.3066258287 -0.1215924858 -0.2098990580 0.5906271603 -0.3398146179
>
> proc.time()
user system elapsed
1.356 1.565 2.908
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: 0x601216e7c0f0>
> .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: 0x601216e7c0f0>
> .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: 0x601216e7c0f0>
> .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: 0x601216e7c0f0>
> 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: 0x601217cca690>
> .Call("R_bm_AddColumn",P)
<pointer: 0x601217cca690>
> .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: 0x601217cca690>
> .Call("R_bm_AddColumn",P)
<pointer: 0x601217cca690>
> .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: 0x601217cca690>
> 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: 0x601219704010>
> .Call("R_bm_AddColumn",P)
<pointer: 0x601219704010>
> .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: 0x601219704010>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x601219704010>
> .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: 0x601219704010>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x601219704010>
> .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: 0x601219704010>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x601219704010>
> .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: 0x601219704010>
> 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: 0x601219754070>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x601219754070>
> .Call("R_bm_AddColumn",P)
<pointer: 0x601219754070>
> .Call("R_bm_AddColumn",P)
<pointer: 0x601219754070>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2ceacf5230cb77" "BufferedMatrixFile2ceacf85a65f3"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2ceacf5230cb77" "BufferedMatrixFile2ceacf85a65f3"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x60121740e7e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60121740e7e0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60121740e7e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60121740e7e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x60121740e7e0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x60121740e7e0>
> .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: 0x6012193aa3b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6012193aa3b0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6012193aa3b0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6012193aa3b0>
> 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: 0x601217570520>
> .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: 0x601217570520>
> rm(P)
>
> proc.time()
user system elapsed
0.247 0.053 0.289
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.271 0.038 0.295