| Back to Build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-05-23 11:32 -0400 (Sat, 23 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-22 22:03:00 -0400 (Fri, 22 May 2026) |
| EndedAt: 2026-05-22 22:03:25 -0400 (Fri, 22 May 2026) |
| EllapsedTime: 25.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.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-23 02:03:00 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.261 0.049 0.296
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] "Fri May 22 22:03:15 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri May 22 22:03:16 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: 0x5dad871b4690>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri May 22 22:03:16 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri May 22 22:03:16 2026"
>
> ColMode(tmp2)
<pointer: 0x5dad871b4690>
>
>
>
> ### 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.849953684 -0.6560362 0.2805693 0.4715446
[2,] 0.136984663 -0.6947274 -1.5866893 0.9153796
[3,] -0.677624384 1.4150926 0.4381569 0.5848899
[4,] 0.007381747 0.4095275 0.1175535 -0.2230917
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 99.849953684 0.6560362 0.2805693 0.4715446
[2,] 0.136984663 0.6947274 1.5866893 0.9153796
[3,] 0.677624384 1.4150926 0.4381569 0.5848899
[4,] 0.007381747 0.4095275 0.1175535 0.2230917
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 9.99249487 0.8099606 0.5296879 0.6866911
[2,] 0.37011439 0.8335031 1.2596385 0.9567547
[3,] 0.82317944 1.1895766 0.6619342 0.7647809
[4,] 0.08591709 0.6399434 0.3428607 0.4723259
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 224.77490 33.75564 30.57745 32.33846
[2,] 28.83813 34.02976 39.18307 35.48293
[3,] 33.90942 38.31086 32.05750 33.23270
[4,] 25.86655 31.80896 28.54616 29.94635
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5dad885680c0>
> exp(tmp5)
<pointer: 0x5dad885680c0>
> log(tmp5,2)
<pointer: 0x5dad885680c0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.8395
> Min(tmp5)
[1] 52.58076
> mean(tmp5)
[1] 72.48485
> Sum(tmp5)
[1] 14496.97
> Var(tmp5)
[1] 869.4487
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.43855 72.20479 71.52753 67.41419 68.35010 66.62053 72.11515 69.62091
[9] 71.62615 73.93058
> rowSums(tmp5)
[1] 1828.771 1444.096 1430.551 1348.284 1367.002 1332.411 1442.303 1392.418
[9] 1432.523 1478.612
> rowVars(tmp5)
[1] 7926.23851 89.09805 43.45312 90.47131 70.50115 49.26280
[7] 82.69168 60.64538 126.87826 94.87839
> rowSd(tmp5)
[1] 89.029425 9.439176 6.591898 9.511641 8.396496 7.018746 9.093497
[8] 7.787514 11.264025 9.740554
> rowMax(tmp5)
[1] 467.83951 90.49922 81.81415 88.16023 91.00037 79.68672 88.30402
[8] 86.97311 92.31559 90.42905
> rowMin(tmp5)
[1] 55.73407 54.62065 56.03449 53.83784 53.84171 55.25207 53.17208 55.36942
[9] 52.58076 58.25933
>
> colMeans(tmp5)
[1] 107.38748 72.98621 68.01936 70.65273 72.43546 71.64470 68.54960
[8] 75.58195 68.82327 66.54987 69.91177 72.22343 64.67734 72.18546
[15] 73.11662 72.72891 74.79995 69.36288 66.53031 71.52966
> colSums(tmp5)
[1] 1073.8748 729.8621 680.1936 706.5273 724.3546 716.4470 685.4960
[8] 755.8195 688.2327 665.4987 699.1177 722.2343 646.7734 721.8546
[15] 731.1662 727.2891 747.9995 693.6288 665.3031 715.2966
> colVars(tmp5)
[1] 16098.86906 66.35200 53.12337 73.53405 152.86632 14.97643
[7] 126.32433 71.17251 34.16243 44.60740 53.16222 130.84380
[13] 81.35274 87.03706 134.48223 116.70160 75.81176 91.31642
[19] 58.37045 64.04458
> colSd(tmp5)
[1] 126.881319 8.145674 7.288578 8.575200 12.363912 3.869939
[7] 11.239410 8.436380 5.844863 6.678877 7.291243 11.438697
[13] 9.019575 9.329365 11.596647 10.802851 8.706995 9.555963
[19] 7.640056 8.002786
> colMax(tmp5)
[1] 467.83951 83.06281 81.55444 92.31559 91.00037 78.24681 90.01781
[8] 88.16023 74.77494 75.71805 79.61072 88.30402 79.53121 89.80430
[15] 90.42905 90.49922 86.92373 86.39962 81.59591 82.47446
> colMin(tmp5)
[1] 53.83784 55.25207 59.41509 61.86017 55.11803 64.27086 54.66994 61.97307
[9] 58.75421 58.27167 55.36942 52.58076 55.73407 60.79019 54.62065 53.17208
[17] 60.46475 59.16405 53.84171 58.25933
>
>
> ### 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.43855 72.20479 71.52753 67.41419 68.35010 NA 72.11515 69.62091
[9] 71.62615 73.93058
> rowSums(tmp5)
[1] 1828.771 1444.096 1430.551 1348.284 1367.002 NA 1442.303 1392.418
[9] 1432.523 1478.612
> rowVars(tmp5)
[1] 7926.23851 89.09805 43.45312 90.47131 70.50115 51.16562
[7] 82.69168 60.64538 126.87826 94.87839
> rowSd(tmp5)
[1] 89.029425 9.439176 6.591898 9.511641 8.396496 7.153015 9.093497
[8] 7.787514 11.264025 9.740554
> rowMax(tmp5)
[1] 467.83951 90.49922 81.81415 88.16023 91.00037 NA 88.30402
[8] 86.97311 92.31559 90.42905
> rowMin(tmp5)
[1] 55.73407 54.62065 56.03449 53.83784 53.84171 NA 53.17208 55.36942
[9] 52.58076 58.25933
>
> colMeans(tmp5)
[1] 107.38748 72.98621 68.01936 70.65273 72.43546 71.64470 68.54960
[8] 75.58195 68.82327 NA 69.91177 72.22343 64.67734 72.18546
[15] 73.11662 72.72891 74.79995 69.36288 66.53031 71.52966
> colSums(tmp5)
[1] 1073.8748 729.8621 680.1936 706.5273 724.3546 716.4470 685.4960
[8] 755.8195 688.2327 NA 699.1177 722.2343 646.7734 721.8546
[15] 731.1662 727.2891 747.9995 693.6288 665.3031 715.2966
> colVars(tmp5)
[1] 16098.86906 66.35200 53.12337 73.53405 152.86632 14.97643
[7] 126.32433 71.17251 34.16243 NA 53.16222 130.84380
[13] 81.35274 87.03706 134.48223 116.70160 75.81176 91.31642
[19] 58.37045 64.04458
> colSd(tmp5)
[1] 126.881319 8.145674 7.288578 8.575200 12.363912 3.869939
[7] 11.239410 8.436380 5.844863 NA 7.291243 11.438697
[13] 9.019575 9.329365 11.596647 10.802851 8.706995 9.555963
[19] 7.640056 8.002786
> colMax(tmp5)
[1] 467.83951 83.06281 81.55444 92.31559 91.00037 78.24681 90.01781
[8] 88.16023 74.77494 NA 79.61072 88.30402 79.53121 89.80430
[15] 90.42905 90.49922 86.92373 86.39962 81.59591 82.47446
> colMin(tmp5)
[1] 53.83784 55.25207 59.41509 61.86017 55.11803 64.27086 54.66994 61.97307
[9] 58.75421 NA 55.36942 52.58076 55.73407 60.79019 54.62065 53.17208
[17] 60.46475 59.16405 53.84171 58.25933
>
> Max(tmp5,na.rm=TRUE)
[1] 467.8395
> Min(tmp5,na.rm=TRUE)
[1] 52.58076
> mean(tmp5,na.rm=TRUE)
[1] 72.49534
> Sum(tmp5,na.rm=TRUE)
[1] 14426.57
> Var(tmp5,na.rm=TRUE)
[1] 873.8177
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.43855 72.20479 71.52753 67.41419 68.35010 66.42177 72.11515 69.62091
[9] 71.62615 73.93058
> rowSums(tmp5,na.rm=TRUE)
[1] 1828.771 1444.096 1430.551 1348.284 1367.002 1262.014 1442.303 1392.418
[9] 1432.523 1478.612
> rowVars(tmp5,na.rm=TRUE)
[1] 7926.23851 89.09805 43.45312 90.47131 70.50115 51.16562
[7] 82.69168 60.64538 126.87826 94.87839
> rowSd(tmp5,na.rm=TRUE)
[1] 89.029425 9.439176 6.591898 9.511641 8.396496 7.153015 9.093497
[8] 7.787514 11.264025 9.740554
> rowMax(tmp5,na.rm=TRUE)
[1] 467.83951 90.49922 81.81415 88.16023 91.00037 79.68672 88.30402
[8] 86.97311 92.31559 90.42905
> rowMin(tmp5,na.rm=TRUE)
[1] 55.73407 54.62065 56.03449 53.83784 53.84171 55.25207 53.17208 55.36942
[9] 52.58076 58.25933
>
> colMeans(tmp5,na.rm=TRUE)
[1] 107.38748 72.98621 68.01936 70.65273 72.43546 71.64470 68.54960
[8] 75.58195 68.82327 66.12242 69.91177 72.22343 64.67734 72.18546
[15] 73.11662 72.72891 74.79995 69.36288 66.53031 71.52966
> colSums(tmp5,na.rm=TRUE)
[1] 1073.8748 729.8621 680.1936 706.5273 724.3546 716.4470 685.4960
[8] 755.8195 688.2327 595.1017 699.1177 722.2343 646.7734 721.8546
[15] 731.1662 727.2891 747.9995 693.6288 665.3031 715.2966
> colVars(tmp5,na.rm=TRUE)
[1] 16098.86906 66.35200 53.12337 73.53405 152.86632 14.97643
[7] 126.32433 71.17251 34.16243 48.12775 53.16222 130.84380
[13] 81.35274 87.03706 134.48223 116.70160 75.81176 91.31642
[19] 58.37045 64.04458
> colSd(tmp5,na.rm=TRUE)
[1] 126.881319 8.145674 7.288578 8.575200 12.363912 3.869939
[7] 11.239410 8.436380 5.844863 6.937416 7.291243 11.438697
[13] 9.019575 9.329365 11.596647 10.802851 8.706995 9.555963
[19] 7.640056 8.002786
> colMax(tmp5,na.rm=TRUE)
[1] 467.83951 83.06281 81.55444 92.31559 91.00037 78.24681 90.01781
[8] 88.16023 74.77494 75.71805 79.61072 88.30402 79.53121 89.80430
[15] 90.42905 90.49922 86.92373 86.39962 81.59591 82.47446
> colMin(tmp5,na.rm=TRUE)
[1] 53.83784 55.25207 59.41509 61.86017 55.11803 64.27086 54.66994 61.97307
[9] 58.75421 58.27167 55.36942 52.58076 55.73407 60.79019 54.62065 53.17208
[17] 60.46475 59.16405 53.84171 58.25933
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.43855 72.20479 71.52753 67.41419 68.35010 NaN 72.11515 69.62091
[9] 71.62615 73.93058
> rowSums(tmp5,na.rm=TRUE)
[1] 1828.771 1444.096 1430.551 1348.284 1367.002 0.000 1442.303 1392.418
[9] 1432.523 1478.612
> rowVars(tmp5,na.rm=TRUE)
[1] 7926.23851 89.09805 43.45312 90.47131 70.50115 NA
[7] 82.69168 60.64538 126.87826 94.87839
> rowSd(tmp5,na.rm=TRUE)
[1] 89.029425 9.439176 6.591898 9.511641 8.396496 NA 9.093497
[8] 7.787514 11.264025 9.740554
> rowMax(tmp5,na.rm=TRUE)
[1] 467.83951 90.49922 81.81415 88.16023 91.00037 NA 88.30402
[8] 86.97311 92.31559 90.42905
> rowMin(tmp5,na.rm=TRUE)
[1] 55.73407 54.62065 56.03449 53.83784 53.84171 NA 53.17208 55.36942
[9] 52.58076 58.25933
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 112.02606 74.95666 68.92636 71.06531 73.44550 71.44503 69.10526
[8] 76.19601 69.94205 NaN 70.44388 71.68757 65.42618 71.65672
[15] 72.38661 73.59610 74.85056 70.47110 66.35338 72.62602
> colSums(tmp5,na.rm=TRUE)
[1] 1008.2345 674.6100 620.3373 639.5878 661.0095 643.0053 621.9473
[8] 685.7641 629.4784 0.0000 633.9949 645.1881 588.8356 644.9105
[15] 651.4795 662.3649 673.6551 634.2399 597.1804 653.6341
> colVars(tmp5,na.rm=TRUE)
[1] 17869.16805 30.96553 50.50891 80.81078 160.49752 16.39997
[7] 138.64142 75.82705 24.35136 NA 56.62219 143.96881
[13] 85.21322 94.77153 145.29719 122.82919 85.25941 88.91429
[19] 65.31458 58.52778
> colSd(tmp5,na.rm=TRUE)
[1] 133.675608 5.564668 7.106962 8.989481 12.668762 4.049688
[7] 11.774609 8.707873 4.934710 NA 7.524772 11.998700
[13] 9.231101 9.735067 12.053929 11.082833 9.233602 9.429437
[19] 8.081744 7.650345
> colMax(tmp5,na.rm=TRUE)
[1] 467.83951 83.06281 81.55444 92.31559 91.00037 78.24681 90.01781
[8] 88.16023 74.77494 -Inf 79.61072 88.30402 79.53121 89.80430
[15] 90.42905 90.49922 86.92373 86.39962 81.59591 82.47446
> colMin(tmp5,na.rm=TRUE)
[1] 53.83784 66.20618 59.41509 61.86017 55.11803 64.27086 54.66994 61.97307
[9] 60.32833 Inf 55.36942 52.58076 55.73407 60.79019 54.62065 53.17208
[17] 60.46475 59.16405 53.84171 58.25933
>
>
>
>
> 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] 165.7555 169.2099 177.0121 244.4773 188.3653 241.9034 204.0370 287.3338
[9] 149.1694 157.3792
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 165.7555 169.2099 177.0121 244.4773 188.3653 241.9034 204.0370 287.3338
[9] 149.1694 157.3792
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] 1.136868e-13 5.684342e-14 -8.526513e-14 -2.842171e-14 1.136868e-13
[6] 5.684342e-14 -1.136868e-13 -8.526513e-14 -2.842171e-14 2.842171e-14
[11] 5.684342e-14 0.000000e+00 5.684342e-14 2.842171e-14 5.684342e-14
[16] -2.842171e-13 -5.684342e-14 -2.273737e-13 -2.842171e-14 0.000000e+00
>
>
>
>
>
>
>
>
>
>
> ## 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 18
9 18
5 18
3 6
3 4
10 17
2 2
6 5
7 17
8 11
4 2
5 1
6 9
1 7
8 17
5 8
7 3
8 20
8 7
6 13
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.034193
> Min(tmp)
[1] -2.925764
> mean(tmp)
[1] -0.03694546
> Sum(tmp)
[1] -3.694546
> Var(tmp)
[1] 1.057904
>
> rowMeans(tmp)
[1] -0.03694546
> rowSums(tmp)
[1] -3.694546
> rowVars(tmp)
[1] 1.057904
> rowSd(tmp)
[1] 1.028545
> rowMax(tmp)
[1] 3.034193
> rowMin(tmp)
[1] -2.925764
>
> colMeans(tmp)
[1] 1.95119255 -0.69256805 -1.11329454 -0.88511937 0.75990154 -0.59488808
[7] 0.26889358 0.40068228 0.23755329 0.48865695 -1.52178051 -1.64652280
[13] -1.56567791 -1.24384639 -0.50419796 1.20073188 0.43755488 -0.51070150
[19] -1.77005239 0.90251401 -0.52283538 1.26535037 -0.99676745 1.02689647
[25] 0.09781431 -0.63445307 0.21573833 1.35588016 1.86479471 -2.92576448
[31] -2.33082834 -0.67642866 -0.92373107 -0.42281611 1.41744858 -0.44053623
[37] 0.09172030 -1.20202112 -0.94064163 0.06671902 -0.50325599 -0.58061498
[43] 1.44453293 0.25486816 -0.38523736 0.17747148 1.46008699 -0.12519319
[49] 0.09280210 0.67767243 0.38833732 0.14134597 0.37999005 0.10492481
[55] 0.59141830 -1.11472536 -1.70348598 0.29432749 -0.30555842 0.16597779
[61] -0.04114489 1.02999513 1.98475501 -0.72818319 1.46957440 1.15718209
[67] 0.31093364 -0.42592906 -1.39989708 -0.52524006 -0.22629241 -0.22807891
[73] 1.81468695 0.17808280 1.01369522 0.11072346 -0.17632033 1.27343891
[79] -0.93949967 -0.19977846 0.22818011 1.16175693 -1.21734233 0.98269216
[85] 0.53144408 -0.40363180 -0.34655059 0.05616968 0.02179795 -1.92280935
[91] 3.03419252 0.43429697 0.02602210 -0.54311662 -0.53955311 0.82299384
[97] -1.77649601 -1.02965437 0.17395742 -0.28185355
> colSums(tmp)
[1] 1.95119255 -0.69256805 -1.11329454 -0.88511937 0.75990154 -0.59488808
[7] 0.26889358 0.40068228 0.23755329 0.48865695 -1.52178051 -1.64652280
[13] -1.56567791 -1.24384639 -0.50419796 1.20073188 0.43755488 -0.51070150
[19] -1.77005239 0.90251401 -0.52283538 1.26535037 -0.99676745 1.02689647
[25] 0.09781431 -0.63445307 0.21573833 1.35588016 1.86479471 -2.92576448
[31] -2.33082834 -0.67642866 -0.92373107 -0.42281611 1.41744858 -0.44053623
[37] 0.09172030 -1.20202112 -0.94064163 0.06671902 -0.50325599 -0.58061498
[43] 1.44453293 0.25486816 -0.38523736 0.17747148 1.46008699 -0.12519319
[49] 0.09280210 0.67767243 0.38833732 0.14134597 0.37999005 0.10492481
[55] 0.59141830 -1.11472536 -1.70348598 0.29432749 -0.30555842 0.16597779
[61] -0.04114489 1.02999513 1.98475501 -0.72818319 1.46957440 1.15718209
[67] 0.31093364 -0.42592906 -1.39989708 -0.52524006 -0.22629241 -0.22807891
[73] 1.81468695 0.17808280 1.01369522 0.11072346 -0.17632033 1.27343891
[79] -0.93949967 -0.19977846 0.22818011 1.16175693 -1.21734233 0.98269216
[85] 0.53144408 -0.40363180 -0.34655059 0.05616968 0.02179795 -1.92280935
[91] 3.03419252 0.43429697 0.02602210 -0.54311662 -0.53955311 0.82299384
[97] -1.77649601 -1.02965437 0.17395742 -0.28185355
> 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.95119255 -0.69256805 -1.11329454 -0.88511937 0.75990154 -0.59488808
[7] 0.26889358 0.40068228 0.23755329 0.48865695 -1.52178051 -1.64652280
[13] -1.56567791 -1.24384639 -0.50419796 1.20073188 0.43755488 -0.51070150
[19] -1.77005239 0.90251401 -0.52283538 1.26535037 -0.99676745 1.02689647
[25] 0.09781431 -0.63445307 0.21573833 1.35588016 1.86479471 -2.92576448
[31] -2.33082834 -0.67642866 -0.92373107 -0.42281611 1.41744858 -0.44053623
[37] 0.09172030 -1.20202112 -0.94064163 0.06671902 -0.50325599 -0.58061498
[43] 1.44453293 0.25486816 -0.38523736 0.17747148 1.46008699 -0.12519319
[49] 0.09280210 0.67767243 0.38833732 0.14134597 0.37999005 0.10492481
[55] 0.59141830 -1.11472536 -1.70348598 0.29432749 -0.30555842 0.16597779
[61] -0.04114489 1.02999513 1.98475501 -0.72818319 1.46957440 1.15718209
[67] 0.31093364 -0.42592906 -1.39989708 -0.52524006 -0.22629241 -0.22807891
[73] 1.81468695 0.17808280 1.01369522 0.11072346 -0.17632033 1.27343891
[79] -0.93949967 -0.19977846 0.22818011 1.16175693 -1.21734233 0.98269216
[85] 0.53144408 -0.40363180 -0.34655059 0.05616968 0.02179795 -1.92280935
[91] 3.03419252 0.43429697 0.02602210 -0.54311662 -0.53955311 0.82299384
[97] -1.77649601 -1.02965437 0.17395742 -0.28185355
> colMin(tmp)
[1] 1.95119255 -0.69256805 -1.11329454 -0.88511937 0.75990154 -0.59488808
[7] 0.26889358 0.40068228 0.23755329 0.48865695 -1.52178051 -1.64652280
[13] -1.56567791 -1.24384639 -0.50419796 1.20073188 0.43755488 -0.51070150
[19] -1.77005239 0.90251401 -0.52283538 1.26535037 -0.99676745 1.02689647
[25] 0.09781431 -0.63445307 0.21573833 1.35588016 1.86479471 -2.92576448
[31] -2.33082834 -0.67642866 -0.92373107 -0.42281611 1.41744858 -0.44053623
[37] 0.09172030 -1.20202112 -0.94064163 0.06671902 -0.50325599 -0.58061498
[43] 1.44453293 0.25486816 -0.38523736 0.17747148 1.46008699 -0.12519319
[49] 0.09280210 0.67767243 0.38833732 0.14134597 0.37999005 0.10492481
[55] 0.59141830 -1.11472536 -1.70348598 0.29432749 -0.30555842 0.16597779
[61] -0.04114489 1.02999513 1.98475501 -0.72818319 1.46957440 1.15718209
[67] 0.31093364 -0.42592906 -1.39989708 -0.52524006 -0.22629241 -0.22807891
[73] 1.81468695 0.17808280 1.01369522 0.11072346 -0.17632033 1.27343891
[79] -0.93949967 -0.19977846 0.22818011 1.16175693 -1.21734233 0.98269216
[85] 0.53144408 -0.40363180 -0.34655059 0.05616968 0.02179795 -1.92280935
[91] 3.03419252 0.43429697 0.02602210 -0.54311662 -0.53955311 0.82299384
[97] -1.77649601 -1.02965437 0.17395742 -0.28185355
> colMedians(tmp)
[1] 1.95119255 -0.69256805 -1.11329454 -0.88511937 0.75990154 -0.59488808
[7] 0.26889358 0.40068228 0.23755329 0.48865695 -1.52178051 -1.64652280
[13] -1.56567791 -1.24384639 -0.50419796 1.20073188 0.43755488 -0.51070150
[19] -1.77005239 0.90251401 -0.52283538 1.26535037 -0.99676745 1.02689647
[25] 0.09781431 -0.63445307 0.21573833 1.35588016 1.86479471 -2.92576448
[31] -2.33082834 -0.67642866 -0.92373107 -0.42281611 1.41744858 -0.44053623
[37] 0.09172030 -1.20202112 -0.94064163 0.06671902 -0.50325599 -0.58061498
[43] 1.44453293 0.25486816 -0.38523736 0.17747148 1.46008699 -0.12519319
[49] 0.09280210 0.67767243 0.38833732 0.14134597 0.37999005 0.10492481
[55] 0.59141830 -1.11472536 -1.70348598 0.29432749 -0.30555842 0.16597779
[61] -0.04114489 1.02999513 1.98475501 -0.72818319 1.46957440 1.15718209
[67] 0.31093364 -0.42592906 -1.39989708 -0.52524006 -0.22629241 -0.22807891
[73] 1.81468695 0.17808280 1.01369522 0.11072346 -0.17632033 1.27343891
[79] -0.93949967 -0.19977846 0.22818011 1.16175693 -1.21734233 0.98269216
[85] 0.53144408 -0.40363180 -0.34655059 0.05616968 0.02179795 -1.92280935
[91] 3.03419252 0.43429697 0.02602210 -0.54311662 -0.53955311 0.82299384
[97] -1.77649601 -1.02965437 0.17395742 -0.28185355
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 1.951193 -0.692568 -1.113295 -0.8851194 0.7599015 -0.5948881 0.2688936
[2,] 1.951193 -0.692568 -1.113295 -0.8851194 0.7599015 -0.5948881 0.2688936
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.4006823 0.2375533 0.4886569 -1.521781 -1.646523 -1.565678 -1.243846
[2,] 0.4006823 0.2375533 0.4886569 -1.521781 -1.646523 -1.565678 -1.243846
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.504198 1.200732 0.4375549 -0.5107015 -1.770052 0.902514 -0.5228354
[2,] -0.504198 1.200732 0.4375549 -0.5107015 -1.770052 0.902514 -0.5228354
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 1.26535 -0.9967675 1.026896 0.09781431 -0.6344531 0.2157383 1.35588
[2,] 1.26535 -0.9967675 1.026896 0.09781431 -0.6344531 0.2157383 1.35588
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 1.864795 -2.925764 -2.330828 -0.6764287 -0.9237311 -0.4228161 1.417449
[2,] 1.864795 -2.925764 -2.330828 -0.6764287 -0.9237311 -0.4228161 1.417449
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.4405362 0.0917203 -1.202021 -0.9406416 0.06671902 -0.503256 -0.580615
[2,] -0.4405362 0.0917203 -1.202021 -0.9406416 0.06671902 -0.503256 -0.580615
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 1.444533 0.2548682 -0.3852374 0.1774715 1.460087 -0.1251932 0.0928021
[2,] 1.444533 0.2548682 -0.3852374 0.1774715 1.460087 -0.1251932 0.0928021
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.6776724 0.3883373 0.141346 0.37999 0.1049248 0.5914183 -1.114725
[2,] 0.6776724 0.3883373 0.141346 0.37999 0.1049248 0.5914183 -1.114725
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -1.703486 0.2943275 -0.3055584 0.1659778 -0.04114489 1.029995 1.984755
[2,] -1.703486 0.2943275 -0.3055584 0.1659778 -0.04114489 1.029995 1.984755
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.7281832 1.469574 1.157182 0.3109336 -0.4259291 -1.399897 -0.5252401
[2,] -0.7281832 1.469574 1.157182 0.3109336 -0.4259291 -1.399897 -0.5252401
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.2262924 -0.2280789 1.814687 0.1780828 1.013695 0.1107235 -0.1763203
[2,] -0.2262924 -0.2280789 1.814687 0.1780828 1.013695 0.1107235 -0.1763203
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 1.273439 -0.9394997 -0.1997785 0.2281801 1.161757 -1.217342 0.9826922
[2,] 1.273439 -0.9394997 -0.1997785 0.2281801 1.161757 -1.217342 0.9826922
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 0.5314441 -0.4036318 -0.3465506 0.05616968 0.02179795 -1.922809 3.034193
[2,] 0.5314441 -0.4036318 -0.3465506 0.05616968 0.02179795 -1.922809 3.034193
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 0.434297 0.0260221 -0.5431166 -0.5395531 0.8229938 -1.776496 -1.029654
[2,] 0.434297 0.0260221 -0.5431166 -0.5395531 0.8229938 -1.776496 -1.029654
[,99] [,100]
[1,] 0.1739574 -0.2818535
[2,] 0.1739574 -0.2818535
>
>
> Max(tmp2)
[1] 2.277225
> Min(tmp2)
[1] -2.314359
> mean(tmp2)
[1] -0.04958036
> Sum(tmp2)
[1] -4.958036
> Var(tmp2)
[1] 0.8435161
>
> rowMeans(tmp2)
[1] -0.27486865 0.90801939 -0.49275502 0.81600205 0.05806636 0.89985782
[7] 0.46528735 0.72275881 -1.63839778 0.34366326 1.63354126 0.39947727
[13] 0.85038861 0.65538282 2.27722526 0.02330981 0.46866244 -1.21708775
[19] -0.27122699 -2.04010199 0.90461703 0.92332791 -1.03559998 -0.29408391
[25] -2.31435852 -0.38108407 -1.87459460 -0.10944871 0.78378215 -0.04169582
[31] -0.25378517 -1.10767963 -0.46632215 0.79075485 1.28881317 1.03028385
[37] 0.85277858 -1.52438259 0.52288263 0.73697114 -1.19473650 0.34939213
[43] 0.50370724 0.03452041 0.32876693 -0.34092722 0.81576351 0.87982432
[49] 0.23865560 0.76090108 0.81555965 0.45520275 0.18638084 0.87376244
[55] 1.11903092 1.11171306 -0.56516667 -1.36833317 -1.39171940 -0.91599964
[61] 0.52219529 -0.14902955 -0.97278279 1.06739409 0.65720711 -1.33094493
[67] -0.71640407 0.95448516 -0.16836942 -1.16079524 -0.58302147 -0.54813056
[73] 0.05117117 -0.41007438 -0.57917891 -0.52240178 0.14335411 0.87711680
[79] -1.15619167 0.29300443 -0.98200700 0.39933304 -0.67239984 -0.02984855
[85] -1.20614596 0.95976382 -0.01966115 -2.10072775 -1.07947566 -0.63931205
[91] -0.19636812 0.48252621 -1.51179273 -0.58609705 0.34107816 0.53796289
[97] -1.71871500 0.87144530 -0.07081972 0.27994345
> rowSums(tmp2)
[1] -0.27486865 0.90801939 -0.49275502 0.81600205 0.05806636 0.89985782
[7] 0.46528735 0.72275881 -1.63839778 0.34366326 1.63354126 0.39947727
[13] 0.85038861 0.65538282 2.27722526 0.02330981 0.46866244 -1.21708775
[19] -0.27122699 -2.04010199 0.90461703 0.92332791 -1.03559998 -0.29408391
[25] -2.31435852 -0.38108407 -1.87459460 -0.10944871 0.78378215 -0.04169582
[31] -0.25378517 -1.10767963 -0.46632215 0.79075485 1.28881317 1.03028385
[37] 0.85277858 -1.52438259 0.52288263 0.73697114 -1.19473650 0.34939213
[43] 0.50370724 0.03452041 0.32876693 -0.34092722 0.81576351 0.87982432
[49] 0.23865560 0.76090108 0.81555965 0.45520275 0.18638084 0.87376244
[55] 1.11903092 1.11171306 -0.56516667 -1.36833317 -1.39171940 -0.91599964
[61] 0.52219529 -0.14902955 -0.97278279 1.06739409 0.65720711 -1.33094493
[67] -0.71640407 0.95448516 -0.16836942 -1.16079524 -0.58302147 -0.54813056
[73] 0.05117117 -0.41007438 -0.57917891 -0.52240178 0.14335411 0.87711680
[79] -1.15619167 0.29300443 -0.98200700 0.39933304 -0.67239984 -0.02984855
[85] -1.20614596 0.95976382 -0.01966115 -2.10072775 -1.07947566 -0.63931205
[91] -0.19636812 0.48252621 -1.51179273 -0.58609705 0.34107816 0.53796289
[97] -1.71871500 0.87144530 -0.07081972 0.27994345
> 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.27486865 0.90801939 -0.49275502 0.81600205 0.05806636 0.89985782
[7] 0.46528735 0.72275881 -1.63839778 0.34366326 1.63354126 0.39947727
[13] 0.85038861 0.65538282 2.27722526 0.02330981 0.46866244 -1.21708775
[19] -0.27122699 -2.04010199 0.90461703 0.92332791 -1.03559998 -0.29408391
[25] -2.31435852 -0.38108407 -1.87459460 -0.10944871 0.78378215 -0.04169582
[31] -0.25378517 -1.10767963 -0.46632215 0.79075485 1.28881317 1.03028385
[37] 0.85277858 -1.52438259 0.52288263 0.73697114 -1.19473650 0.34939213
[43] 0.50370724 0.03452041 0.32876693 -0.34092722 0.81576351 0.87982432
[49] 0.23865560 0.76090108 0.81555965 0.45520275 0.18638084 0.87376244
[55] 1.11903092 1.11171306 -0.56516667 -1.36833317 -1.39171940 -0.91599964
[61] 0.52219529 -0.14902955 -0.97278279 1.06739409 0.65720711 -1.33094493
[67] -0.71640407 0.95448516 -0.16836942 -1.16079524 -0.58302147 -0.54813056
[73] 0.05117117 -0.41007438 -0.57917891 -0.52240178 0.14335411 0.87711680
[79] -1.15619167 0.29300443 -0.98200700 0.39933304 -0.67239984 -0.02984855
[85] -1.20614596 0.95976382 -0.01966115 -2.10072775 -1.07947566 -0.63931205
[91] -0.19636812 0.48252621 -1.51179273 -0.58609705 0.34107816 0.53796289
[97] -1.71871500 0.87144530 -0.07081972 0.27994345
> rowMin(tmp2)
[1] -0.27486865 0.90801939 -0.49275502 0.81600205 0.05806636 0.89985782
[7] 0.46528735 0.72275881 -1.63839778 0.34366326 1.63354126 0.39947727
[13] 0.85038861 0.65538282 2.27722526 0.02330981 0.46866244 -1.21708775
[19] -0.27122699 -2.04010199 0.90461703 0.92332791 -1.03559998 -0.29408391
[25] -2.31435852 -0.38108407 -1.87459460 -0.10944871 0.78378215 -0.04169582
[31] -0.25378517 -1.10767963 -0.46632215 0.79075485 1.28881317 1.03028385
[37] 0.85277858 -1.52438259 0.52288263 0.73697114 -1.19473650 0.34939213
[43] 0.50370724 0.03452041 0.32876693 -0.34092722 0.81576351 0.87982432
[49] 0.23865560 0.76090108 0.81555965 0.45520275 0.18638084 0.87376244
[55] 1.11903092 1.11171306 -0.56516667 -1.36833317 -1.39171940 -0.91599964
[61] 0.52219529 -0.14902955 -0.97278279 1.06739409 0.65720711 -1.33094493
[67] -0.71640407 0.95448516 -0.16836942 -1.16079524 -0.58302147 -0.54813056
[73] 0.05117117 -0.41007438 -0.57917891 -0.52240178 0.14335411 0.87711680
[79] -1.15619167 0.29300443 -0.98200700 0.39933304 -0.67239984 -0.02984855
[85] -1.20614596 0.95976382 -0.01966115 -2.10072775 -1.07947566 -0.63931205
[91] -0.19636812 0.48252621 -1.51179273 -0.58609705 0.34107816 0.53796289
[97] -1.71871500 0.87144530 -0.07081972 0.27994345
>
> colMeans(tmp2)
[1] -0.04958036
> colSums(tmp2)
[1] -4.958036
> colVars(tmp2)
[1] 0.8435161
> colSd(tmp2)
[1] 0.9184313
> colMax(tmp2)
[1] 2.277225
> colMin(tmp2)
[1] -2.314359
> colMedians(tmp2)
[1] 0.04284579
> colRanges(tmp2)
[,1]
[1,] -2.314359
[2,] 2.277225
>
> 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] -4.96010484 -0.02925767 -4.36701447 3.02064096 3.41183708 -0.73437082
[7] 0.31003188 3.35107306 2.32555158 -1.72773633
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.51275758
[2,] -1.19109809
[3,] -0.45754101
[4,] -0.06759309
[5,] 0.91765713
>
> rowApply(tmp,sum)
[1] -0.95998790 -3.41597472 -0.01629928 3.42714790 -0.48630413 3.06447957
[7] 2.20489392 0.12146781 -3.31983236 -0.01894038
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 2 2 5 3 1 4 8 5 6 1
[2,] 1 1 6 5 7 6 10 1 9 6
[3,] 10 6 1 1 8 3 2 2 2 4
[4,] 3 8 10 2 5 2 7 10 8 8
[5,] 9 10 2 7 2 10 5 7 7 10
[6,] 4 5 7 9 4 1 3 8 5 7
[7,] 8 4 8 4 3 7 6 9 3 5
[8,] 5 9 9 10 9 5 4 6 4 3
[9,] 6 3 4 8 10 8 9 4 1 9
[10,] 7 7 3 6 6 9 1 3 10 2
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 1.2347143 -0.5150903 -2.8425802 -4.1126873 2.4421377 2.9152409
[7] 1.1973446 -1.8708874 -2.3972329 3.6666409 0.9382425 -2.1176735
[13] 2.6214827 0.4949296 3.1232071 0.3554477 -1.2898798 0.3823967
[19] -2.2833672 -0.4236806
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.6736366
[2,] -0.5504961
[3,] 0.4765629
[4,] 0.8075033
[5,] 1.1747808
>
> rowApply(tmp,sum)
[1] 1.054947 -3.720098 3.685131 -4.054506 4.553231
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 17 17 4 7 13
[2,] 12 3 9 1 20
[3,] 1 8 19 6 3
[4,] 6 1 2 13 6
[5,] 9 9 17 15 18
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1.1747808 0.6621419 -2.3715677 -0.34717009 0.3040525 0.02134246
[2,] 0.8075033 -1.5229261 -0.5597514 -2.12090113 -0.5253126 2.07488793
[3,] -0.6736366 -0.2792288 1.4420793 -1.08917043 1.1260193 0.78351854
[4,] -0.5504961 -2.1225134 -0.5664644 0.07173734 0.3666727 -0.14462801
[5,] 0.4765629 2.7474359 -0.7868761 -0.62718298 1.1707059 0.18012000
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 1.20514538 -0.34117953 -1.0815676 0.4441947 1.1219109 0.7373705
[2,] -1.77901652 -0.81393248 -1.0139246 -0.8232505 -0.2755776 0.2246561
[3,] 0.87412293 -0.40651389 0.3297594 1.7524644 -0.1464365 -1.2056950
[4,] 0.85575214 -0.08923605 0.6055303 1.2868341 -0.4274031 -1.0589454
[5,] 0.04134068 -0.22002541 -1.2370303 1.0063982 0.6657488 -0.8150596
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 1.32306456 -0.8552740 0.4236540 0.7478974 -1.90208787 1.33594815
[2,] -0.59848738 0.4074017 -0.3542072 0.4848120 -0.09204776 0.38272436
[3,] 0.81786736 0.8662823 0.5011189 -0.5369954 -0.50041992 -0.38867201
[4,] -0.07028715 0.7926873 1.2869818 -0.2356509 0.35527201 -0.87230264
[5,] 1.14932532 -0.7161676 1.2656597 -0.1046153 0.84940371 -0.07530111
[,19] [,20]
[1,] -2.2692641 0.7215544
[2,] 1.2625789 1.1146734
[3,] 1.3457999 -0.9271324
[4,] -1.8696945 -1.6683517
[5,] -0.7527874 0.3355758
>
>
> 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 : 653 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.4825356 -0.3405552 -0.8267622 -1.331489 2.39903 -0.2988505 -0.5614508
col8 col9 col10 col11 col12 col13 col14
row1 0.5644885 -0.2180306 1.964412 0.6229574 0.1482484 -0.9260175 -0.6188717
col15 col16 col17 col18 col19 col20
row1 1.269296 -0.7788371 0.3119255 -0.3588028 -0.6946545 0.4727573
> tmp[,"col10"]
col10
row1 1.9644116
row2 -0.5403148
row3 -1.8675759
row4 0.2236546
row5 -2.6506859
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 0.4825356 -0.340555189 -0.8267622 -1.3314887 2.3990302 -0.2988505
row5 -0.5382813 0.003623248 -0.3464456 -0.4976315 -0.5220026 -0.5495275
col7 col8 col9 col10 col11 col12
row1 -0.5614508 0.5644885 -0.21803061 1.964412 0.6229574 0.1482484
row5 0.8086764 -0.3080198 -0.05782456 -2.650686 -0.1956645 0.4193207
col13 col14 col15 col16 col17 col18 col19
row1 -0.9260175 -0.6188717 1.2692958 -0.7788371 0.3119255 -0.3588028 -0.6946545
row5 0.2991756 1.5253617 0.7021461 -0.5041138 1.9467896 1.8637556 0.6349235
col20
row1 0.4727573
row5 -2.3734323
> tmp[,c("col6","col20")]
col6 col20
row1 -0.2988505 0.4727573
row2 -0.3192162 0.6616074
row3 0.2267931 2.3686232
row4 -0.7794756 -1.5039658
row5 -0.5495275 -2.3734323
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.2988505 0.4727573
row5 -0.5495275 -2.3734323
>
>
>
>
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105)
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.81235 48.80748 51.79653 49.3873 49.4228 103.6698 49.57933 49.76498
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.52078 49.21784 49.08833 49.25601 50.56789 49.3856 49.7373 49.12398
col17 col18 col19 col20
row1 50.18731 49.09756 49.31355 104.8172
> tmp[,"col10"]
col10
row1 49.21784
row2 28.86554
row3 29.34608
row4 29.18523
row5 50.46082
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.81235 48.80748 51.79653 49.38730 49.42280 103.6698 49.57933 49.76498
row5 49.43851 49.78724 49.85456 48.38917 50.20145 104.7200 51.51865 48.44825
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.52078 49.21784 49.08833 49.25601 50.56789 49.38560 49.73730 49.12398
row5 49.47498 50.46082 49.91472 49.10856 50.34680 49.14896 50.12313 50.68692
col17 col18 col19 col20
row1 50.18731 49.09756 49.31355 104.8172
row5 51.37860 51.71828 50.00682 106.8476
> tmp[,c("col6","col20")]
col6 col20
row1 103.66984 104.81719
row2 75.85277 75.46871
row3 74.45203 74.71388
row4 73.74582 75.05134
row5 104.72002 106.84764
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 103.6698 104.8172
row5 104.7200 106.8476
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 103.6698 104.8172
row5 104.7200 106.8476
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.2410976
[2,] 0.7309221
[3,] -0.6494527
[4,] -1.1476940
[5,] 1.0028759
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.9528213 -0.0141735
[2,] -0.6159790 -1.7701835
[3,] -0.5200325 -0.7892498
[4,] 0.3311149 -0.6089099
[5,] 2.3151372 0.3385445
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -1.5253733 0.8316026
[2,] 0.1177184 1.0629949
[3,] -0.6008954 0.7526299
[4,] 0.5527794 -0.6523182
[5,] 0.1621574 0.8493942
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -1.525373
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -1.5253733
[2,] 0.1177184
>
>
>
> 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.364707 0.3166277 1.045039 -0.2099344 -0.2443585 -0.59470256 -1.3273995
row1 1.448680 1.5563620 -1.464065 0.6099047 -1.2328349 0.06503459 -0.6087917
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 -1.041440 1.5640114 -2.02134 0.0605637 0.1621680 1.1741303 0.6352549
row1 -1.535365 -0.3296749 0.55244 -0.8621669 0.5642709 0.3802051 1.2903757
[,15] [,16] [,17] [,18] [,19] [,20]
row3 0.09337473 -1.1564104 0.1339321 0.8708147 -0.5766772 -0.8756185
row1 -0.21099043 0.7954138 0.5152269 1.6270326 0.2000842 -1.1460738
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.9764263 0.7567787 -1.737376 -1.28593 -0.09311395 -2.434484 0.03779737
[,8] [,9] [,10]
row2 -0.2499681 3.005645 -0.706893
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.1465209 1.979335 0.8776472 -0.1582332 -0.8243447 0.09377982 -0.7152666
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 1.396227 1.415557 -0.7961848 -0.2545537 -0.09443 1.069892 -1.258396
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.1372832 -1.076426 0.5425873 0.410751 -0.9282934 -0.2693425
>
>
> 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: 0x5dad88779740>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12c3f176f87432"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12c3f155bc8662"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12c3f166c5b226"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12c3f142d2ae16"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12c3f12514d667"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12c3f11ef2baff"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12c3f153d021a7"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12c3f1c46821a"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12c3f165ba5aca"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12c3f14e761b8a"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12c3f12202f697"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12c3f1339dbae6"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12c3f12f3507f5"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12c3f19af6967"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM12c3f17a5f5553"
>
>
> ### 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: 0x5dad88d884d0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5dad88d884d0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5dad88d884d0>
> rowMedians(tmp)
[1] 0.025911061 -0.191935298 0.082193050 0.534535285 -0.390750423
[6] -0.318495595 -0.193144808 0.169783530 -0.243543145 -0.128126712
[11] -0.013413734 -0.114491516 0.014759509 0.407694918 0.216924303
[16] -0.152850923 -0.666627884 0.172359690 -0.260999155 -0.457818615
[21] -0.227487795 0.278479360 -0.067847251 0.152602337 0.176129686
[26] -0.048300206 -0.122788363 -0.141479986 -0.090356165 0.055185105
[31] -0.425723989 -0.068610459 -0.191121391 -0.659246004 -0.174412139
[36] -0.417855224 -0.010746624 0.425230781 -0.174543707 -0.190845257
[41] 0.521450559 0.108195948 -0.421638619 0.036694049 0.173782232
[46] -0.002303013 -0.080857270 0.091674686 -0.121339831 0.297756911
[51] -0.198937489 0.361911708 -0.070633992 -0.032884124 0.296419667
[56] 0.267819083 -0.410507050 -0.170763342 0.361181993 0.218780726
[61] -0.074996044 0.128994837 0.188134860 -0.273255478 -0.266548426
[66] 0.443402010 0.124120451 0.332134132 0.552295848 -0.158734431
[71] -0.989562720 0.048601853 -0.156010364 0.196056136 -0.022694899
[76] -0.567711735 0.109009741 -0.109001716 -0.063791490 0.348337880
[81] 0.327622795 0.180104091 -0.156735458 -0.362649947 -0.751997040
[86] -0.693342445 0.344722760 0.124280148 0.230848638 0.474720223
[91] 0.044898166 0.680655496 0.091401932 0.205612323 0.497073864
[96] -0.059672356 0.166310244 0.041554231 0.410274293 0.365934609
[101] -0.438055236 0.146129527 0.055787666 -0.130810114 -0.470411977
[106] 0.393914558 0.017638955 0.017706812 -0.317430130 -0.359980086
[111] -0.108939052 -0.055270562 -0.270935056 -0.181292391 0.248112065
[116] 0.237013192 -0.065777220 -0.394587870 0.223381422 -0.036552014
[121] -0.179917007 0.080558932 -0.011156614 0.012187026 -0.626998063
[126] 0.390130725 0.314285256 -0.643445673 0.061453565 -0.028217306
[131] 0.015986291 0.107535181 0.299579365 0.070717477 0.557814334
[136] 0.075975939 0.322548189 -0.082256094 0.254653635 0.061712465
[141] -0.403080241 0.077952319 0.121165791 0.360498384 -0.110169917
[146] -0.032631357 0.180860452 -0.609533820 0.017055466 0.096962595
[151] -0.262073591 0.478730400 0.126298910 0.397473128 -0.375290623
[156] -0.671811470 0.300976628 -0.295096955 0.138632187 0.070236074
[161] -0.031741872 -0.283500805 0.377947775 -0.002566191 0.178103793
[166] 0.083282514 0.146398200 -0.282459684 -0.646254887 0.089009471
[171] -0.458820321 0.067006760 -0.163185846 0.218936436 0.303827509
[176] -0.111162348 0.129863485 -0.083429002 -0.223897931 -0.722006147
[181] -0.062384875 -0.522476225 0.190873628 0.304014065 -0.247992240
[186] -0.143803851 -0.134119262 -0.331238329 -0.076632625 -0.396932772
[191] -0.001157969 -0.270699548 0.257568920 -0.019804244 0.425382415
[196] 0.086617117 0.185839353 0.081656810 0.749667677 -0.284219657
[201] 0.404995802 -0.195916948 -0.202622948 -0.071159007 0.207814007
[206] -0.032079262 0.326100662 -0.884654950 -0.297138161 0.236651044
[211] -0.049051231 0.051293521 -0.222442382 -0.259052285 0.310056417
[216] -0.035642486 -0.005499722 -0.166342394 0.072958411 0.163576705
[221] -0.122745785 -0.089792904 -0.127160117 -0.048102535 -0.317128112
[226] 0.467401630 0.082064801 -0.315762362 0.218605954 0.328376861
>
> proc.time()
user system elapsed
1.381 1.585 2.956
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: 0x5b31f8b5d0f0>
> .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: 0x5b31f8b5d0f0>
> .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: 0x5b31f8b5d0f0>
> .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: 0x5b31f8b5d0f0>
> 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: 0x5b31f99ab690>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b31f99ab690>
> .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: 0x5b31f99ab690>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b31f99ab690>
> .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: 0x5b31f99ab690>
> 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: 0x5b31fb3e5010>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b31fb3e5010>
> .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: 0x5b31fb3e5010>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5b31fb3e5010>
> .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: 0x5b31fb3e5010>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5b31fb3e5010>
> .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: 0x5b31fb3e5010>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5b31fb3e5010>
> .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: 0x5b31fb3e5010>
> 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: 0x5b31fb435070>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5b31fb435070>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b31fb435070>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b31fb435070>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile12c72546072e60" "BufferedMatrixFile12c725674728fc"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile12c72546072e60" "BufferedMatrixFile12c725674728fc"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b31f90ef7e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b31f90ef7e0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5b31f90ef7e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5b31f90ef7e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5b31f90ef7e0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5b31f90ef7e0>
> .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: 0x5b31fb08b3b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b31fb08b3b0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5b31fb08b3b0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5b31fb08b3b0>
> 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: 0x5b31f9251520>
> .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: 0x5b31f9251520>
> rm(P)
>
> proc.time()
user system elapsed
0.265 0.049 0.300
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.245 0.050 0.284