| Back to Build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-05-19 11:32 -0400 (Tue, 19 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-18 22:06:06 -0400 (Mon, 18 May 2026) |
| EndedAt: 2026-05-18 22:06:31 -0400 (Mon, 18 May 2026) |
| EllapsedTime: 25.1 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-19 02:06:06 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.247 0.045 0.281
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] "Mon May 18 22:06:22 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] "Mon May 18 22:06:22 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: 0x5c020e4ef690>
>
>
>
> 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] "Mon May 18 22:06:22 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] "Mon May 18 22:06:22 2026"
>
> ColMode(tmp2)
<pointer: 0x5c020e4ef690>
>
>
>
> ### 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,] 101.90920392 1.2873914 -0.2480154 -1.5450944
[2,] 0.04177664 -0.3304034 0.3423262 -1.1267487
[3,] 0.03064379 1.2585196 0.8316868 -0.8095915
[4,] -0.96188222 0.2829540 -0.2223708 1.0136033
> 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,] 101.90920392 1.2873914 0.2480154 1.5450944
[2,] 0.04177664 0.3304034 0.3423262 1.1267487
[3,] 0.03064379 1.2585196 0.8316868 0.8095915
[4,] 0.96188222 0.2829540 0.2223708 1.0136033
> 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.0950089 1.1346327 0.4980114 1.243018
[2,] 0.2043934 0.5748072 0.5850865 1.061484
[3,] 0.1750537 1.1218376 0.9119686 0.899773
[4,] 0.9807559 0.5319342 0.4715621 1.006779
>
> 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,] 227.85929 37.63372 30.22813 38.97528
[2,] 27.08571 31.07848 31.19319 36.74159
[3,] 26.78118 37.47690 34.95137 34.80732
[4,] 35.76944 30.60230 29.93799 36.08139
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5c020f8a30c0>
> exp(tmp5)
<pointer: 0x5c020f8a30c0>
> log(tmp5,2)
<pointer: 0x5c020f8a30c0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 474.2593
> Min(tmp5)
[1] 52.80267
> mean(tmp5)
[1] 72.45656
> Sum(tmp5)
[1] 14491.31
> Var(tmp5)
[1] 891.2942
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.08715 72.65041 70.41542 70.52564 68.28100 71.09177 70.36720 69.49978
[9] 68.71572 71.93153
> rowSums(tmp5)
[1] 1821.743 1453.008 1408.308 1410.513 1365.620 1421.835 1407.344 1389.996
[9] 1374.314 1438.631
> rowVars(tmp5)
[1] 8205.61840 116.34061 105.81794 58.90786 50.60805 79.04088
[7] 63.94244 78.75740 85.83968 67.41116
> rowSd(tmp5)
[1] 90.584869 10.786130 10.286785 7.675145 7.113933 8.890494 7.996402
[8] 8.874537 9.264971 8.210430
> rowMax(tmp5)
[1] 474.25926 96.31122 91.95367 83.41507 81.83157 86.25102 83.27089
[8] 86.90757 86.72697 89.55823
> rowMin(tmp5)
[1] 53.58551 53.48616 55.74152 57.74567 58.52502 55.06553 54.79544 55.96666
[9] 52.80267 58.63369
>
> colMeans(tmp5)
[1] 107.86915 67.87443 67.43974 75.43524 70.44102 74.90741 71.01203
[8] 68.06357 70.34216 68.74221 68.26357 74.19252 74.41772 69.75369
[15] 72.86154 68.23338 71.97361 71.34268 66.32647 69.63908
> colSums(tmp5)
[1] 1078.6915 678.7443 674.3974 754.3524 704.4102 749.0741 710.1203
[8] 680.6357 703.4216 687.4221 682.6357 741.9252 744.1772 697.5369
[15] 728.6154 682.3338 719.7361 713.4268 663.2647 696.3908
> colVars(tmp5)
[1] 16655.08076 66.85498 20.37854 76.16682 113.10176 87.17133
[7] 100.82248 42.27654 19.06835 65.88423 64.51470 102.34627
[13] 78.83722 150.34839 85.17802 60.96758 75.53366 74.41988
[19] 73.55031 77.72996
> colSd(tmp5)
[1] 129.054565 8.176489 4.514259 8.727361 10.634931 9.336559
[7] 10.041040 6.502041 4.366732 8.116910 8.032105 10.116633
[13] 8.879032 12.261663 9.229194 7.808174 8.691010 8.626696
[19] 8.576148 8.816460
> colMax(tmp5)
[1] 474.25926 80.30734 75.66523 86.72697 85.02978 86.96500 91.95367
[8] 77.77492 75.30728 83.27089 78.11743 86.61347 89.55823 96.31122
[15] 86.25102 79.37493 83.02074 84.94465 82.72207 80.71858
> colMin(tmp5)
[1] 55.74152 58.59932 62.31201 55.06553 58.63369 59.42436 60.84216 57.01288
[9] 63.19546 59.16481 54.79544 52.80267 57.69363 55.96666 61.29315 57.74567
[17] 59.00090 59.59146 53.58551 53.48616
>
>
> ### 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.08715 72.65041 NA 70.52564 68.28100 71.09177 70.36720 69.49978
[9] 68.71572 71.93153
> rowSums(tmp5)
[1] 1821.743 1453.008 NA 1410.513 1365.620 1421.835 1407.344 1389.996
[9] 1374.314 1438.631
> rowVars(tmp5)
[1] 8205.61840 116.34061 111.45538 58.90786 50.60805 79.04088
[7] 63.94244 78.75740 85.83968 67.41116
> rowSd(tmp5)
[1] 90.584869 10.786130 10.557243 7.675145 7.113933 8.890494 7.996402
[8] 8.874537 9.264971 8.210430
> rowMax(tmp5)
[1] 474.25926 96.31122 NA 83.41507 81.83157 86.25102 83.27089
[8] 86.90757 86.72697 89.55823
> rowMin(tmp5)
[1] 53.58551 53.48616 NA 57.74567 58.52502 55.06553 54.79544 55.96666
[9] 52.80267 58.63369
>
> colMeans(tmp5)
[1] 107.86915 67.87443 67.43974 NA 70.44102 74.90741 71.01203
[8] 68.06357 70.34216 68.74221 68.26357 74.19252 74.41772 69.75369
[15] 72.86154 68.23338 71.97361 71.34268 66.32647 69.63908
> colSums(tmp5)
[1] 1078.6915 678.7443 674.3974 NA 704.4102 749.0741 710.1203
[8] 680.6357 703.4216 687.4221 682.6357 741.9252 744.1772 697.5369
[15] 728.6154 682.3338 719.7361 713.4268 663.2647 696.3908
> colVars(tmp5)
[1] 16655.08076 66.85498 20.37854 NA 113.10176 87.17133
[7] 100.82248 42.27654 19.06835 65.88423 64.51470 102.34627
[13] 78.83722 150.34839 85.17802 60.96758 75.53366 74.41988
[19] 73.55031 77.72996
> colSd(tmp5)
[1] 129.054565 8.176489 4.514259 NA 10.634931 9.336559
[7] 10.041040 6.502041 4.366732 8.116910 8.032105 10.116633
[13] 8.879032 12.261663 9.229194 7.808174 8.691010 8.626696
[19] 8.576148 8.816460
> colMax(tmp5)
[1] 474.25926 80.30734 75.66523 NA 85.02978 86.96500 91.95367
[8] 77.77492 75.30728 83.27089 78.11743 86.61347 89.55823 96.31122
[15] 86.25102 79.37493 83.02074 84.94465 82.72207 80.71858
> colMin(tmp5)
[1] 55.74152 58.59932 62.31201 NA 58.63369 59.42436 60.84216 57.01288
[9] 63.19546 59.16481 54.79544 52.80267 57.69363 55.96666 61.29315 57.74567
[17] 59.00090 59.59146 53.58551 53.48616
>
> Max(tmp5,na.rm=TRUE)
[1] 474.2593
> Min(tmp5,na.rm=TRUE)
[1] 52.80267
> mean(tmp5,na.rm=TRUE)
[1] 72.45661
> Sum(tmp5,na.rm=TRUE)
[1] 14418.87
> Var(tmp5,na.rm=TRUE)
[1] 895.7956
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.08715 72.65041 70.30850 70.52564 68.28100 71.09177 70.36720 69.49978
[9] 68.71572 71.93153
> rowSums(tmp5,na.rm=TRUE)
[1] 1821.743 1453.008 1335.862 1410.513 1365.620 1421.835 1407.344 1389.996
[9] 1374.314 1438.631
> rowVars(tmp5,na.rm=TRUE)
[1] 8205.61840 116.34061 111.45538 58.90786 50.60805 79.04088
[7] 63.94244 78.75740 85.83968 67.41116
> rowSd(tmp5,na.rm=TRUE)
[1] 90.584869 10.786130 10.557243 7.675145 7.113933 8.890494 7.996402
[8] 8.874537 9.264971 8.210430
> rowMax(tmp5,na.rm=TRUE)
[1] 474.25926 96.31122 91.95367 83.41507 81.83157 86.25102 83.27089
[8] 86.90757 86.72697 89.55823
> rowMin(tmp5,na.rm=TRUE)
[1] 53.58551 53.48616 55.74152 57.74567 58.52502 55.06553 54.79544 55.96666
[9] 52.80267 58.63369
>
> colMeans(tmp5,na.rm=TRUE)
[1] 107.86915 67.87443 67.43974 75.76728 70.44102 74.90741 71.01203
[8] 68.06357 70.34216 68.74221 68.26357 74.19252 74.41772 69.75369
[15] 72.86154 68.23338 71.97361 71.34268 66.32647 69.63908
> colSums(tmp5,na.rm=TRUE)
[1] 1078.6915 678.7443 674.3974 681.9055 704.4102 749.0741 710.1203
[8] 680.6357 703.4216 687.4221 682.6357 741.9252 744.1772 697.5369
[15] 728.6154 682.3338 719.7361 713.4268 663.2647 696.3908
> colVars(tmp5,na.rm=TRUE)
[1] 16655.08076 66.85498 20.37854 84.44736 113.10176 87.17133
[7] 100.82248 42.27654 19.06835 65.88423 64.51470 102.34627
[13] 78.83722 150.34839 85.17802 60.96758 75.53366 74.41988
[19] 73.55031 77.72996
> colSd(tmp5,na.rm=TRUE)
[1] 129.054565 8.176489 4.514259 9.189524 10.634931 9.336559
[7] 10.041040 6.502041 4.366732 8.116910 8.032105 10.116633
[13] 8.879032 12.261663 9.229194 7.808174 8.691010 8.626696
[19] 8.576148 8.816460
> colMax(tmp5,na.rm=TRUE)
[1] 474.25926 80.30734 75.66523 86.72697 85.02978 86.96500 91.95367
[8] 77.77492 75.30728 83.27089 78.11743 86.61347 89.55823 96.31122
[15] 86.25102 79.37493 83.02074 84.94465 82.72207 80.71858
> colMin(tmp5,na.rm=TRUE)
[1] 55.74152 58.59932 62.31201 55.06553 58.63369 59.42436 60.84216 57.01288
[9] 63.19546 59.16481 54.79544 52.80267 57.69363 55.96666 61.29315 57.74567
[17] 59.00090 59.59146 53.58551 53.48616
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.08715 72.65041 NaN 70.52564 68.28100 71.09177 70.36720 69.49978
[9] 68.71572 71.93153
> rowSums(tmp5,na.rm=TRUE)
[1] 1821.743 1453.008 0.000 1410.513 1365.620 1421.835 1407.344 1389.996
[9] 1374.314 1438.631
> rowVars(tmp5,na.rm=TRUE)
[1] 8205.61840 116.34061 NA 58.90786 50.60805 79.04088
[7] 63.94244 78.75740 85.83968 67.41116
> rowSd(tmp5,na.rm=TRUE)
[1] 90.584869 10.786130 NA 7.675145 7.113933 8.890494 7.996402
[8] 8.874537 9.264971 8.210430
> rowMax(tmp5,na.rm=TRUE)
[1] 474.25926 96.31122 NA 83.41507 81.83157 86.25102 83.27089
[8] 86.90757 86.72697 89.55823
> rowMin(tmp5,na.rm=TRUE)
[1] 53.58551 53.48616 NA 57.74567 58.52502 55.06553 54.79544 55.96666
[9] 52.80267 58.63369
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 113.66111 66.74901 66.85008 NaN 69.76267 76.11071 68.68518
[8] 68.76205 71.13624 69.11403 69.00380 75.38845 73.58530 71.23398
[15] 74.14692 68.46598 72.50022 69.83135 64.50473 68.40803
> colSums(tmp5,na.rm=TRUE)
[1] 1022.9500 600.7411 601.6507 0.0000 627.8640 684.9964 618.1666
[8] 618.8584 640.2262 622.0263 621.0342 678.4960 662.2677 641.1058
[15] 667.3223 616.1938 652.5020 628.4822 580.5426 615.6722
> colVars(tmp5,na.rm=TRUE)
[1] 18359.56450 60.96284 19.01421 NA 122.06269 81.77845
[7] 52.51528 42.07260 14.35809 72.56446 66.41483 99.04929
[13] 80.89643 144.49033 77.23808 67.97986 81.85560 58.02605
[19] 45.40858 70.39685
> colSd(tmp5,na.rm=TRUE)
[1] 135.497470 7.807870 4.360529 NA 11.048199 9.043144
[7] 7.246742 6.486339 3.789207 8.518478 8.149529 9.952351
[13] 8.994244 12.020413 8.788520 8.244990 9.047409 7.617483
[19] 6.738589 8.390283
> colMax(tmp5,na.rm=TRUE)
[1] 474.25926 80.30734 75.66523 -Inf 85.02978 86.96500 83.40535
[8] 77.77492 75.30728 83.27089 78.11743 86.61347 89.55823 96.31122
[15] 86.25102 79.37493 83.02074 81.51201 77.39422 79.54235
> colMin(tmp5,na.rm=TRUE)
[1] 56.37536 58.59932 62.31201 Inf 58.63369 59.42436 60.84216 57.01288
[9] 64.16590 59.16481 54.79544 52.80267 57.69363 55.96666 62.39131 57.74567
[17] 59.00090 59.59146 53.58551 53.48616
>
>
>
>
> 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.91150 253.17859 147.91603 345.42041 267.88288 260.05003 174.88288
[8] 213.47958 316.83867 82.19107
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 165.91150 253.17859 147.91603 345.42041 267.88288 260.05003 174.88288
[8] 213.47958 316.83867 82.19107
>
>
>
> 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 -1.136868e-13 -1.136868e-13 2.842171e-14 5.684342e-14
[6] 1.705303e-13 8.526513e-14 1.705303e-13 1.136868e-13 1.136868e-13
[11] -2.842171e-14 2.842171e-13 1.136868e-13 -1.705303e-13 -1.705303e-13
[16] -1.705303e-13 0.000000e+00 2.273737e-13 5.684342e-14 8.526513e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
7 14
3 7
10 2
1 2
9 18
8 16
6 10
6 8
7 18
7 11
9 11
5 16
5 13
2 19
7 18
9 17
3 16
7 20
5 17
7 10
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 1.901219
> Min(tmp)
[1] -2.384464
> mean(tmp)
[1] -0.03393832
> Sum(tmp)
[1] -3.393832
> Var(tmp)
[1] 0.9451422
>
> rowMeans(tmp)
[1] -0.03393832
> rowSums(tmp)
[1] -3.393832
> rowVars(tmp)
[1] 0.9451422
> rowSd(tmp)
[1] 0.9721842
> rowMax(tmp)
[1] 1.901219
> rowMin(tmp)
[1] -2.384464
>
> colMeans(tmp)
[1] 0.94112112 1.12578220 1.06683530 -0.01287863 0.33897715 0.60300217
[7] -1.03800964 0.71235032 0.58057096 -1.05567863 -1.62413006 0.01997806
[13] -0.75678076 -0.88440661 -0.58979211 -0.35359123 1.10458761 0.32639543
[19] -0.81994543 0.21372586 -1.21068919 1.14777481 -1.20473479 0.65572738
[25] -0.80947833 -2.38446385 0.59913398 -1.49863284 -0.65079005 1.57845385
[31] 0.37357400 -0.68386846 0.07769316 -1.19364382 -1.10916987 -0.31155477
[37] -1.00308852 -0.07065787 0.29593231 -0.72692208 -0.07733183 1.90121873
[43] 1.12436754 1.32298999 0.70326056 0.84067713 -0.60523202 0.17640364
[49] -1.27549622 -0.10616375 -0.87445399 1.39065658 0.75011144 0.48447575
[55] -1.73690212 -1.39729160 0.35087057 1.19357301 -0.72451165 -0.53466320
[61] 1.63600528 1.60436735 -0.32722893 1.11995516 -0.30650292 -0.61518731
[67] -0.89419237 -0.22316075 -0.56666927 1.55444773 1.69486418 -0.15806772
[73] -0.31383288 0.15826210 1.65259807 -0.53992427 0.59001339 1.47959942
[79] -1.15322500 -0.13157255 1.19353226 -1.13371012 -0.08658944 0.69120758
[85] -0.02268182 0.09635149 -2.15347975 -0.99369312 -0.26410205 0.44292973
[91] -2.05072956 -0.77504066 -0.60029758 0.53857659 -0.76276289 0.44873499
[97] -0.59026601 0.88320430 1.02222989 -0.21306174
> colSums(tmp)
[1] 0.94112112 1.12578220 1.06683530 -0.01287863 0.33897715 0.60300217
[7] -1.03800964 0.71235032 0.58057096 -1.05567863 -1.62413006 0.01997806
[13] -0.75678076 -0.88440661 -0.58979211 -0.35359123 1.10458761 0.32639543
[19] -0.81994543 0.21372586 -1.21068919 1.14777481 -1.20473479 0.65572738
[25] -0.80947833 -2.38446385 0.59913398 -1.49863284 -0.65079005 1.57845385
[31] 0.37357400 -0.68386846 0.07769316 -1.19364382 -1.10916987 -0.31155477
[37] -1.00308852 -0.07065787 0.29593231 -0.72692208 -0.07733183 1.90121873
[43] 1.12436754 1.32298999 0.70326056 0.84067713 -0.60523202 0.17640364
[49] -1.27549622 -0.10616375 -0.87445399 1.39065658 0.75011144 0.48447575
[55] -1.73690212 -1.39729160 0.35087057 1.19357301 -0.72451165 -0.53466320
[61] 1.63600528 1.60436735 -0.32722893 1.11995516 -0.30650292 -0.61518731
[67] -0.89419237 -0.22316075 -0.56666927 1.55444773 1.69486418 -0.15806772
[73] -0.31383288 0.15826210 1.65259807 -0.53992427 0.59001339 1.47959942
[79] -1.15322500 -0.13157255 1.19353226 -1.13371012 -0.08658944 0.69120758
[85] -0.02268182 0.09635149 -2.15347975 -0.99369312 -0.26410205 0.44292973
[91] -2.05072956 -0.77504066 -0.60029758 0.53857659 -0.76276289 0.44873499
[97] -0.59026601 0.88320430 1.02222989 -0.21306174
> colVars(tmp)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colSd(tmp)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> colMax(tmp)
[1] 0.94112112 1.12578220 1.06683530 -0.01287863 0.33897715 0.60300217
[7] -1.03800964 0.71235032 0.58057096 -1.05567863 -1.62413006 0.01997806
[13] -0.75678076 -0.88440661 -0.58979211 -0.35359123 1.10458761 0.32639543
[19] -0.81994543 0.21372586 -1.21068919 1.14777481 -1.20473479 0.65572738
[25] -0.80947833 -2.38446385 0.59913398 -1.49863284 -0.65079005 1.57845385
[31] 0.37357400 -0.68386846 0.07769316 -1.19364382 -1.10916987 -0.31155477
[37] -1.00308852 -0.07065787 0.29593231 -0.72692208 -0.07733183 1.90121873
[43] 1.12436754 1.32298999 0.70326056 0.84067713 -0.60523202 0.17640364
[49] -1.27549622 -0.10616375 -0.87445399 1.39065658 0.75011144 0.48447575
[55] -1.73690212 -1.39729160 0.35087057 1.19357301 -0.72451165 -0.53466320
[61] 1.63600528 1.60436735 -0.32722893 1.11995516 -0.30650292 -0.61518731
[67] -0.89419237 -0.22316075 -0.56666927 1.55444773 1.69486418 -0.15806772
[73] -0.31383288 0.15826210 1.65259807 -0.53992427 0.59001339 1.47959942
[79] -1.15322500 -0.13157255 1.19353226 -1.13371012 -0.08658944 0.69120758
[85] -0.02268182 0.09635149 -2.15347975 -0.99369312 -0.26410205 0.44292973
[91] -2.05072956 -0.77504066 -0.60029758 0.53857659 -0.76276289 0.44873499
[97] -0.59026601 0.88320430 1.02222989 -0.21306174
> colMin(tmp)
[1] 0.94112112 1.12578220 1.06683530 -0.01287863 0.33897715 0.60300217
[7] -1.03800964 0.71235032 0.58057096 -1.05567863 -1.62413006 0.01997806
[13] -0.75678076 -0.88440661 -0.58979211 -0.35359123 1.10458761 0.32639543
[19] -0.81994543 0.21372586 -1.21068919 1.14777481 -1.20473479 0.65572738
[25] -0.80947833 -2.38446385 0.59913398 -1.49863284 -0.65079005 1.57845385
[31] 0.37357400 -0.68386846 0.07769316 -1.19364382 -1.10916987 -0.31155477
[37] -1.00308852 -0.07065787 0.29593231 -0.72692208 -0.07733183 1.90121873
[43] 1.12436754 1.32298999 0.70326056 0.84067713 -0.60523202 0.17640364
[49] -1.27549622 -0.10616375 -0.87445399 1.39065658 0.75011144 0.48447575
[55] -1.73690212 -1.39729160 0.35087057 1.19357301 -0.72451165 -0.53466320
[61] 1.63600528 1.60436735 -0.32722893 1.11995516 -0.30650292 -0.61518731
[67] -0.89419237 -0.22316075 -0.56666927 1.55444773 1.69486418 -0.15806772
[73] -0.31383288 0.15826210 1.65259807 -0.53992427 0.59001339 1.47959942
[79] -1.15322500 -0.13157255 1.19353226 -1.13371012 -0.08658944 0.69120758
[85] -0.02268182 0.09635149 -2.15347975 -0.99369312 -0.26410205 0.44292973
[91] -2.05072956 -0.77504066 -0.60029758 0.53857659 -0.76276289 0.44873499
[97] -0.59026601 0.88320430 1.02222989 -0.21306174
> colMedians(tmp)
[1] 0.94112112 1.12578220 1.06683530 -0.01287863 0.33897715 0.60300217
[7] -1.03800964 0.71235032 0.58057096 -1.05567863 -1.62413006 0.01997806
[13] -0.75678076 -0.88440661 -0.58979211 -0.35359123 1.10458761 0.32639543
[19] -0.81994543 0.21372586 -1.21068919 1.14777481 -1.20473479 0.65572738
[25] -0.80947833 -2.38446385 0.59913398 -1.49863284 -0.65079005 1.57845385
[31] 0.37357400 -0.68386846 0.07769316 -1.19364382 -1.10916987 -0.31155477
[37] -1.00308852 -0.07065787 0.29593231 -0.72692208 -0.07733183 1.90121873
[43] 1.12436754 1.32298999 0.70326056 0.84067713 -0.60523202 0.17640364
[49] -1.27549622 -0.10616375 -0.87445399 1.39065658 0.75011144 0.48447575
[55] -1.73690212 -1.39729160 0.35087057 1.19357301 -0.72451165 -0.53466320
[61] 1.63600528 1.60436735 -0.32722893 1.11995516 -0.30650292 -0.61518731
[67] -0.89419237 -0.22316075 -0.56666927 1.55444773 1.69486418 -0.15806772
[73] -0.31383288 0.15826210 1.65259807 -0.53992427 0.59001339 1.47959942
[79] -1.15322500 -0.13157255 1.19353226 -1.13371012 -0.08658944 0.69120758
[85] -0.02268182 0.09635149 -2.15347975 -0.99369312 -0.26410205 0.44292973
[91] -2.05072956 -0.77504066 -0.60029758 0.53857659 -0.76276289 0.44873499
[97] -0.59026601 0.88320430 1.02222989 -0.21306174
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.9411211 1.125782 1.066835 -0.01287863 0.3389771 0.6030022 -1.03801
[2,] 0.9411211 1.125782 1.066835 -0.01287863 0.3389771 0.6030022 -1.03801
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.7123503 0.580571 -1.055679 -1.62413 0.01997806 -0.7567808 -0.8844066
[2,] 0.7123503 0.580571 -1.055679 -1.62413 0.01997806 -0.7567808 -0.8844066
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.5897921 -0.3535912 1.104588 0.3263954 -0.8199454 0.2137259 -1.210689
[2,] -0.5897921 -0.3535912 1.104588 0.3263954 -0.8199454 0.2137259 -1.210689
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 1.147775 -1.204735 0.6557274 -0.8094783 -2.384464 0.599134 -1.498633
[2,] 1.147775 -1.204735 0.6557274 -0.8094783 -2.384464 0.599134 -1.498633
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.65079 1.578454 0.373574 -0.6838685 0.07769316 -1.193644 -1.10917
[2,] -0.65079 1.578454 0.373574 -0.6838685 0.07769316 -1.193644 -1.10917
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.3115548 -1.003089 -0.07065787 0.2959323 -0.7269221 -0.07733183 1.901219
[2,] -0.3115548 -1.003089 -0.07065787 0.2959323 -0.7269221 -0.07733183 1.901219
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 1.124368 1.32299 0.7032606 0.8406771 -0.605232 0.1764036 -1.275496
[2,] 1.124368 1.32299 0.7032606 0.8406771 -0.605232 0.1764036 -1.275496
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.1061638 -0.874454 1.390657 0.7501114 0.4844758 -1.736902 -1.397292
[2,] -0.1061638 -0.874454 1.390657 0.7501114 0.4844758 -1.736902 -1.397292
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.3508706 1.193573 -0.7245116 -0.5346632 1.636005 1.604367 -0.3272289
[2,] 0.3508706 1.193573 -0.7245116 -0.5346632 1.636005 1.604367 -0.3272289
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 1.119955 -0.3065029 -0.6151873 -0.8941924 -0.2231607 -0.5666693 1.554448
[2,] 1.119955 -0.3065029 -0.6151873 -0.8941924 -0.2231607 -0.5666693 1.554448
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 1.694864 -0.1580677 -0.3138329 0.1582621 1.652598 -0.5399243 0.5900134
[2,] 1.694864 -0.1580677 -0.3138329 0.1582621 1.652598 -0.5399243 0.5900134
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 1.479599 -1.153225 -0.1315726 1.193532 -1.13371 -0.08658944 0.6912076
[2,] 1.479599 -1.153225 -0.1315726 1.193532 -1.13371 -0.08658944 0.6912076
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.02268182 0.09635149 -2.15348 -0.9936931 -0.264102 0.4429297 -2.05073
[2,] -0.02268182 0.09635149 -2.15348 -0.9936931 -0.264102 0.4429297 -2.05073
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.7750407 -0.6002976 0.5385766 -0.7627629 0.448735 -0.590266 0.8832043
[2,] -0.7750407 -0.6002976 0.5385766 -0.7627629 0.448735 -0.590266 0.8832043
[,99] [,100]
[1,] 1.02223 -0.2130617
[2,] 1.02223 -0.2130617
>
>
> Max(tmp2)
[1] 1.960517
> Min(tmp2)
[1] -2.113731
> mean(tmp2)
[1] -0.09754325
> Sum(tmp2)
[1] -9.754325
> Var(tmp2)
[1] 0.8586787
>
> rowMeans(tmp2)
[1] -0.68072096 0.44825394 -0.44627715 1.62599504 -0.42812336 0.26003488
[7] -1.15255298 0.46657267 0.08785502 -0.19493452 0.17371264 1.14731103
[13] -1.87268110 0.52191777 -0.07030361 -1.06290491 0.82761696 1.96051742
[19] 1.17122324 0.79610144 -0.42928747 -0.98268760 -1.32464896 1.03475914
[25] 0.42769828 0.39614726 -0.95886528 0.28948411 -0.11841228 0.43564572
[31] 0.83535302 -0.18646677 -0.57577288 -0.43279513 -2.11373075 0.15017287
[37] 0.48080343 -0.43063938 0.14929208 0.25400433 0.89629608 -0.54237610
[43] -2.08029396 0.82257061 1.03336778 0.13595283 -0.95401477 0.54933291
[49] -0.80171128 -1.91323586 0.91980737 -0.83015471 -0.84361692 0.33767500
[55] 1.15796239 -1.93358249 0.51689448 -0.07504321 -2.06017127 -0.51580418
[61] -0.75756932 1.73630891 0.53092164 -1.16170411 0.06770445 0.88804241
[67] -1.52268971 -1.12559977 0.59379834 0.38644999 1.04033252 -0.58519615
[73] -0.24104025 -1.02927139 -0.60341702 0.20500327 0.78639390 0.97610992
[79] 0.87830093 -0.98370509 1.14137401 0.56626455 -1.50866065 0.77093560
[85] 0.47224771 0.42520849 -0.83661953 -0.06713641 -0.05765488 -1.74364516
[91] -0.22398982 -0.39133561 -0.68643784 -0.03722325 -1.08592061 0.07244639
[97] -0.49244110 -1.02324490 1.47050887 -0.89669669
> rowSums(tmp2)
[1] -0.68072096 0.44825394 -0.44627715 1.62599504 -0.42812336 0.26003488
[7] -1.15255298 0.46657267 0.08785502 -0.19493452 0.17371264 1.14731103
[13] -1.87268110 0.52191777 -0.07030361 -1.06290491 0.82761696 1.96051742
[19] 1.17122324 0.79610144 -0.42928747 -0.98268760 -1.32464896 1.03475914
[25] 0.42769828 0.39614726 -0.95886528 0.28948411 -0.11841228 0.43564572
[31] 0.83535302 -0.18646677 -0.57577288 -0.43279513 -2.11373075 0.15017287
[37] 0.48080343 -0.43063938 0.14929208 0.25400433 0.89629608 -0.54237610
[43] -2.08029396 0.82257061 1.03336778 0.13595283 -0.95401477 0.54933291
[49] -0.80171128 -1.91323586 0.91980737 -0.83015471 -0.84361692 0.33767500
[55] 1.15796239 -1.93358249 0.51689448 -0.07504321 -2.06017127 -0.51580418
[61] -0.75756932 1.73630891 0.53092164 -1.16170411 0.06770445 0.88804241
[67] -1.52268971 -1.12559977 0.59379834 0.38644999 1.04033252 -0.58519615
[73] -0.24104025 -1.02927139 -0.60341702 0.20500327 0.78639390 0.97610992
[79] 0.87830093 -0.98370509 1.14137401 0.56626455 -1.50866065 0.77093560
[85] 0.47224771 0.42520849 -0.83661953 -0.06713641 -0.05765488 -1.74364516
[91] -0.22398982 -0.39133561 -0.68643784 -0.03722325 -1.08592061 0.07244639
[97] -0.49244110 -1.02324490 1.47050887 -0.89669669
> 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.68072096 0.44825394 -0.44627715 1.62599504 -0.42812336 0.26003488
[7] -1.15255298 0.46657267 0.08785502 -0.19493452 0.17371264 1.14731103
[13] -1.87268110 0.52191777 -0.07030361 -1.06290491 0.82761696 1.96051742
[19] 1.17122324 0.79610144 -0.42928747 -0.98268760 -1.32464896 1.03475914
[25] 0.42769828 0.39614726 -0.95886528 0.28948411 -0.11841228 0.43564572
[31] 0.83535302 -0.18646677 -0.57577288 -0.43279513 -2.11373075 0.15017287
[37] 0.48080343 -0.43063938 0.14929208 0.25400433 0.89629608 -0.54237610
[43] -2.08029396 0.82257061 1.03336778 0.13595283 -0.95401477 0.54933291
[49] -0.80171128 -1.91323586 0.91980737 -0.83015471 -0.84361692 0.33767500
[55] 1.15796239 -1.93358249 0.51689448 -0.07504321 -2.06017127 -0.51580418
[61] -0.75756932 1.73630891 0.53092164 -1.16170411 0.06770445 0.88804241
[67] -1.52268971 -1.12559977 0.59379834 0.38644999 1.04033252 -0.58519615
[73] -0.24104025 -1.02927139 -0.60341702 0.20500327 0.78639390 0.97610992
[79] 0.87830093 -0.98370509 1.14137401 0.56626455 -1.50866065 0.77093560
[85] 0.47224771 0.42520849 -0.83661953 -0.06713641 -0.05765488 -1.74364516
[91] -0.22398982 -0.39133561 -0.68643784 -0.03722325 -1.08592061 0.07244639
[97] -0.49244110 -1.02324490 1.47050887 -0.89669669
> rowMin(tmp2)
[1] -0.68072096 0.44825394 -0.44627715 1.62599504 -0.42812336 0.26003488
[7] -1.15255298 0.46657267 0.08785502 -0.19493452 0.17371264 1.14731103
[13] -1.87268110 0.52191777 -0.07030361 -1.06290491 0.82761696 1.96051742
[19] 1.17122324 0.79610144 -0.42928747 -0.98268760 -1.32464896 1.03475914
[25] 0.42769828 0.39614726 -0.95886528 0.28948411 -0.11841228 0.43564572
[31] 0.83535302 -0.18646677 -0.57577288 -0.43279513 -2.11373075 0.15017287
[37] 0.48080343 -0.43063938 0.14929208 0.25400433 0.89629608 -0.54237610
[43] -2.08029396 0.82257061 1.03336778 0.13595283 -0.95401477 0.54933291
[49] -0.80171128 -1.91323586 0.91980737 -0.83015471 -0.84361692 0.33767500
[55] 1.15796239 -1.93358249 0.51689448 -0.07504321 -2.06017127 -0.51580418
[61] -0.75756932 1.73630891 0.53092164 -1.16170411 0.06770445 0.88804241
[67] -1.52268971 -1.12559977 0.59379834 0.38644999 1.04033252 -0.58519615
[73] -0.24104025 -1.02927139 -0.60341702 0.20500327 0.78639390 0.97610992
[79] 0.87830093 -0.98370509 1.14137401 0.56626455 -1.50866065 0.77093560
[85] 0.47224771 0.42520849 -0.83661953 -0.06713641 -0.05765488 -1.74364516
[91] -0.22398982 -0.39133561 -0.68643784 -0.03722325 -1.08592061 0.07244639
[97] -0.49244110 -1.02324490 1.47050887 -0.89669669
>
> colMeans(tmp2)
[1] -0.09754325
> colSums(tmp2)
[1] -9.754325
> colVars(tmp2)
[1] 0.8586787
> colSd(tmp2)
[1] 0.9266492
> colMax(tmp2)
[1] 1.960517
> colMin(tmp2)
[1] -2.113731
> colMedians(tmp2)
[1] -0.04743906
> colRanges(tmp2)
[,1]
[1,] -2.113731
[2,] 1.960517
>
> 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.932353 -4.078964 6.255553 1.628640 2.814677 -1.856595 3.420561
[8] 0.688175 1.238272 -3.253794
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.478079793
[2,] -1.248356157
[3,] -0.001361038
[4,] 0.502564686
[5,] 1.215477402
>
> rowApply(tmp,sum)
[1] 1.6666240 3.5012724 1.7187159 -2.9693818 -3.2891424 4.1045577
[7] 0.5263924 0.0789178 3.2213530 -5.6351364
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 2 5 7 9 2 9 2 5 4 2
[2,] 1 3 6 1 5 3 5 7 6 3
[3,] 6 9 10 4 6 10 8 1 9 9
[4,] 10 1 9 10 3 7 6 8 2 4
[5,] 9 10 8 2 9 2 1 10 5 6
[6,] 5 4 4 6 1 5 4 6 3 10
[7,] 7 2 3 8 8 8 10 3 7 5
[8,] 8 8 5 3 10 6 7 9 1 1
[9,] 3 7 2 7 7 4 9 4 8 8
[10,] 4 6 1 5 4 1 3 2 10 7
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 4.710232753 -0.576114160 -2.115889018 -0.382611560 1.907498996
[6] -0.005466069 -0.213367919 -3.472673873 0.804494615 -1.893886561
[11] 3.257739357 -2.314771919 -0.621262915 -2.168930199 -3.307827073
[16] -0.499249204 1.061562976 -1.794905717 -3.406355078 0.001280931
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.2069041
[2,] 0.1861384
[3,] 0.8269122
[4,] 1.9306483
[5,] 1.9734379
>
> rowApply(tmp,sum)
[1] -5.092462 -2.378341 3.163766 -1.413210 -5.310254
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 13 17 20 20 15
[2,] 9 20 13 1 8
[3,] 7 14 19 8 1
[4,] 1 13 9 3 19
[5,] 17 12 10 10 18
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.2069041 -0.5749642 -0.6748301 -1.6835047 0.5263634 -1.16634183
[2,] 0.8269122 1.3422189 0.4375516 0.3062232 0.2336850 1.18581776
[3,] 1.9734379 0.7626365 1.7539222 0.2005884 0.2327166 -0.89213295
[4,] 1.9306483 -1.4578807 -0.4813487 -0.7285025 -0.1657190 0.82717637
[5,] 0.1861384 -0.6481246 -3.1511839 1.5225840 1.0804530 0.04001457
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 1.4781271 -1.1277297 1.0149453 -0.7676742 -0.4075880 -0.33457956
[2,] -0.2141166 -0.5195431 -1.3225370 0.1246362 0.4396568 -1.68202314
[3,] -0.3264336 -1.9101097 -0.3983240 0.5351787 1.0697276 0.83472991
[4,] -0.1393538 0.7739719 1.2367543 -0.5432814 -0.1112672 -0.09217476
[5,] -1.0115910 -0.6892632 0.2736561 -1.2427459 2.2672103 -1.04072437
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 1.38113388 -1.6333109 -0.76356445 0.1102363 0.4383460 -0.5891573
[2,] -2.25992362 -0.0226600 -1.31103007 0.5269445 1.3409558 -1.0001657
[3,] 0.97058183 0.3946287 -1.56536255 -0.2998266 -0.5487544 1.1602729
[4,] -0.69838061 -0.5970726 0.04333119 -0.4230195 0.1792164 -0.6938018
[5,] -0.01467439 -0.3105155 0.28879880 -0.4135839 -0.3482007 -0.6720538
[,19] [,20]
[1,] -0.5126381 0.40117297
[2,] -0.7891333 -0.02181057
[3,] -2.1884272 1.40471573
[4,] 0.9205228 -1.19302845
[5,] -0.8366793 -0.58976874
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 654 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 -0.1164639 1.802583 1.843337 0.7973288 -0.3089432 0.6638717 0.5410533
col8 col9 col10 col11 col12 col13 col14
row1 1.235165 0.9953898 2.665979 0.4975965 -1.813416 0.5874445 -0.7420284
col15 col16 col17 col18 col19 col20
row1 0.6102359 1.444237 0.4307617 0.1428436 -0.3617289 -1.013066
> tmp[,"col10"]
col10
row1 2.6659789
row2 1.0783994
row3 2.0283242
row4 0.9838794
row5 0.4108630
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -0.1164639 1.80258282 1.8433374 0.7973288 -0.3089432 0.66387169
row5 1.1598793 0.06958682 -0.4894596 -0.4441283 -1.0004870 0.05895626
col7 col8 col9 col10 col11 col12 col13
row1 0.5410533 1.2351647 0.9953898 2.665979 0.4975965 -1.8134158 0.58744450
row5 1.4328359 -0.2045934 0.8256634 0.410863 0.1076921 -0.4446273 0.02771876
col14 col15 col16 col17 col18 col19
row1 -0.7420284 0.6102359 1.4442367 0.4307617 0.1428436 -0.361728893
row5 0.2917275 -1.2111144 0.5804635 -1.3580451 -0.1114562 0.002952622
col20
row1 -1.013066
row5 -2.895014
> tmp[,c("col6","col20")]
col6 col20
row1 0.66387169 -1.01306636
row2 -0.47399502 -0.73999227
row3 0.93483369 0.98635173
row4 -1.08270377 -0.07224574
row5 0.05895626 -2.89501424
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.66387169 -1.013066
row5 0.05895626 -2.895014
>
>
>
>
> 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.29896 49.36106 50.10977 51.95407 50.78333 103.0794 49.27293 47.62962
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.56686 49.57654 48.73989 50.44495 49.90067 50.71078 48.80751 50.33093
col17 col18 col19 col20
row1 48.71212 50.76459 52.44089 104.9745
> tmp[,"col10"]
col10
row1 49.57654
row2 28.81077
row3 31.40996
row4 30.59322
row5 49.05903
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.29896 49.36106 50.10977 51.95407 50.78333 103.0794 49.27293 47.62962
row5 49.04790 50.68627 47.88351 50.68657 48.58572 105.3188 49.31468 50.73495
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.56686 49.57654 48.73989 50.44495 49.90067 50.71078 48.80751 50.33093
row5 49.77061 49.05903 49.15753 49.25446 49.08866 49.39819 50.61462 50.25173
col17 col18 col19 col20
row1 48.71212 50.76459 52.44089 104.9745
row5 48.94477 49.46799 51.68880 104.5439
> tmp[,c("col6","col20")]
col6 col20
row1 103.07938 104.97447
row2 74.88266 74.79693
row3 76.88815 74.86075
row4 75.16458 75.29236
row5 105.31884 104.54391
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 103.0794 104.9745
row5 105.3188 104.5439
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 103.0794 104.9745
row5 105.3188 104.5439
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.62287225
[2,] 0.25316926
[3,] -0.05620391
[4,] -0.44061054
[5,] -0.38286231
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.2241827 -0.3495038
[2,] 0.8003906 1.3111906
[3,] -0.1477554 -1.1567918
[4,] -1.6369651 0.7425856
[5,] -0.3778401 0.1583330
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.60215559 0.7183707
[2,] -1.12476074 -0.8725224
[3,] 0.66931742 0.6018008
[4,] -0.06090296 -0.6996847
[5,] 0.57122705 1.9381528
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.6021556
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.6021556
[2,] -1.1247607
>
>
>
> 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.5781696 1.361607 0.9651526 0.6862466 -0.08104382 0.4328902 -1.4302818
row1 0.8483507 1.983761 0.6262260 -0.1150853 0.00366565 1.0081063 0.2659332
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 1.361142 -0.1911857 0.5127947 0.1095286 -0.91932744 0.1375837 0.3760056
row1 -1.547322 -1.4553743 -1.3061179 1.0576023 0.06925246 -2.0772360 0.3586012
[,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.7396167 -1.1018549 1.454223 0.2545643 1.39138398 -0.1049738
row1 -0.7303717 0.9364721 -0.482990 0.3046980 -0.08395973 -0.9544132
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -2.04855 -0.613333 0.01471428 0.04256515 0.1652446 -0.3146741 0.6205452
[,8] [,9] [,10]
row2 2.075351 -0.5647652 0.1808408
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 1.146589 0.4838104 -0.03648806 0.1682257 -1.722034 0.7537053 0.8832233
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 1.233726 0.6526809 -0.8435878 -0.5075364 -0.01255918 -0.9702465 1.069058
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.6553003 -0.1301618 0.8467914 -0.1637787 0.01153932 0.04345921
>
>
> 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: 0x5c020e419d70>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c3a6beeb9a3"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c3a65a4234b9"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c3a67b3a6478"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c3a62794c95d"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c3a6121eb895"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c3a647e62287"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c3a6391c3c6e"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c3a63e776843"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c3a63de6c255"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c3a617cb0a25"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c3a61d815ff8"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c3a628483534"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c3a660f7773f"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c3a655ab632a"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM16c3a61d13fc43"
>
>
> ### 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: 0x5c0211b0be00>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5c0211b0be00>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5c0211b0be00>
> rowMedians(tmp)
[1] 0.6261031737 0.1835522235 0.0917696654 0.4458141444 -0.0456946340
[6] -0.4551412350 -0.2579476414 0.3375846344 0.3825597897 0.0660412178
[11] 0.2681376671 -0.4224502763 0.1335435751 0.1052978084 -0.4903957764
[16] 0.4528797372 0.1165583544 -0.4811387783 -0.2440607398 0.1187259825
[21] -0.3551850600 0.3203267675 -0.7164807464 -0.0139043350 -0.0640189868
[26] 0.0325225528 -0.1732703176 -0.2984051065 0.0166464423 -0.2680824856
[31] -0.4997453201 0.1791859747 -0.0369255344 -0.2980788902 0.3844364690
[36] 0.0047443161 0.2142725852 0.1231014443 -0.1265609213 -0.1679541125
[41] 0.3425590594 -0.0476209666 -0.2330587537 -0.1021478166 0.2670511397
[46] 0.6150750276 0.1562160558 0.2853203322 0.4124337093 -0.0717439535
[51] 0.2559425373 0.6972532072 -0.3129465871 0.0719889158 -0.0917976295
[56] -0.0955423942 0.1119822132 0.6184495236 -0.6059227474 0.3661192303
[61] 0.2145153339 -0.3314453761 -0.0322417938 -0.9040083919 0.4567836214
[66] 0.4518752313 0.1938450503 0.1468919552 0.0596038731 0.0105488650
[71] -0.0010217851 0.0895379326 -0.2153388860 0.2417385332 0.0118389532
[76] -0.7298414667 -0.0800886280 -0.3360385479 -0.1291875991 0.0006470118
[81] 0.4327947877 0.8377941950 -0.0028389731 0.3272664573 0.0525728509
[86] 0.1878171380 0.1605104491 -0.7652548974 -0.0078535318 0.7206026446
[91] -0.2348607309 -0.3580240612 0.0398136890 -0.3908431924 0.0914954761
[96] -0.0164122484 -0.1630879802 -0.1627301519 0.1423227456 0.2863665566
[101] 0.6755402769 0.0717280538 -0.2622434317 -0.1441134343 0.3630404822
[106] -0.7631828449 -0.1235863370 0.2149778170 0.4720912489 0.0994035826
[111] 0.2998891342 0.0789266508 0.3851906584 -0.0701828234 0.0103056745
[116] 0.1626751390 -0.1495568339 0.2427700497 -0.1625393779 -0.3911588271
[121] -0.4299804552 -0.0390363609 -0.1348157680 0.2383841740 0.1656635313
[126] 0.1328329030 -0.1189407332 -0.0963581292 0.0181616400 0.0957265942
[131] -0.1103195305 -0.2219541749 0.0600516014 -0.4457389615 0.5445001095
[136] -0.0289073858 -0.2025651829 0.9694073274 -0.3520488191 -0.4546408042
[141] 0.2857126356 0.1854717373 0.4175575475 -0.0463893659 0.5844877830
[146] -0.1541583389 0.2320640933 -0.0877526058 -0.1622448764 -0.0873543844
[151] -0.2040364904 -0.2642941551 0.3440623798 -0.0372130045 0.2750157289
[156] -0.2386207590 -0.5667385502 -0.5061908982 -0.4310184499 -0.3245333771
[161] -0.1609913674 -1.0283994555 -0.0168178185 -0.3626170321 -0.0655127689
[166] 0.5069984378 0.1521620711 -0.4596781735 0.2587700996 0.1441023712
[171] 0.3726725062 -0.1570565684 0.1295537656 -0.3117850228 -0.2120348715
[176] -0.9290922932 -0.4067063022 -0.1943819721 -0.3124491989 -0.2040627725
[181] -0.2953992179 -0.0056585741 -0.2527437921 -0.2593140215 -0.1959545481
[186] 0.1609836415 -0.5120920351 0.1893529408 -0.0820320314 -0.1138454905
[191] 0.3669211060 -0.1199336163 -0.2832168662 -0.0556327857 -0.2784619266
[196] 0.0322148646 -0.0800369174 -0.1517084536 -0.0543789890 -0.6628500139
[201] -0.1005326349 -0.5130195244 0.1058446108 -0.1137828965 0.5461649410
[206] -0.0602841288 -0.7653746612 0.4980614575 -0.1029774935 -0.0550852353
[211] -0.0268924641 -0.2382907912 -0.3239831994 -0.2432949513 -0.2052993545
[216] 0.0469200624 -0.4060973549 -0.4190197810 -0.1597130591 -0.2761579802
[221] -0.1885470700 0.9291216042 -0.3729015292 -0.5863975917 0.0992017679
[226] -0.3004012367 -0.1387042603 0.2133114663 -0.1486820385 0.3042259176
>
> proc.time()
user system elapsed
1.287 1.595 2.871
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: 0x65203023d0f0>
> .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: 0x65203023d0f0>
> .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: 0x65203023d0f0>
> .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: 0x65203023d0f0>
> 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: 0x65203108b690>
> .Call("R_bm_AddColumn",P)
<pointer: 0x65203108b690>
> .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: 0x65203108b690>
> .Call("R_bm_AddColumn",P)
<pointer: 0x65203108b690>
> .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: 0x65203108b690>
> 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: 0x652032ac5010>
> .Call("R_bm_AddColumn",P)
<pointer: 0x652032ac5010>
> .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: 0x652032ac5010>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x652032ac5010>
> .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: 0x652032ac5010>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x652032ac5010>
> .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: 0x652032ac5010>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x652032ac5010>
> .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: 0x652032ac5010>
> 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: 0x652032b15070>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x652032b15070>
> .Call("R_bm_AddColumn",P)
<pointer: 0x652032b15070>
> .Call("R_bm_AddColumn",P)
<pointer: 0x652032b15070>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile16c51c2c65a686" "BufferedMatrixFile16c51c593c7bfb"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile16c51c2c65a686" "BufferedMatrixFile16c51c593c7bfb"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6520307cf7e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6520307cf7e0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6520307cf7e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6520307cf7e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6520307cf7e0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6520307cf7e0>
> .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: 0x65203276b3b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x65203276b3b0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x65203276b3b0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x65203276b3b0>
> 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: 0x652030931520>
> .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: 0x652030931520>
> rm(P)
>
> proc.time()
user system elapsed
0.253 0.049 0.290
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.247 0.040 0.275