| Back to Build/check report for BioC 3.24: simplified long |
|
This page was generated on 2026-04-27 11:32 -0400 (Mon, 27 Apr 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.4 LTS) | x86_64 | 4.6.0 RC (2026-04-17 r89917) -- "Because it was There" | 4822 |
| 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 252/2365 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.4 LTS) / x86_64 | OK | OK | OK | |||||||||
| See other builds for BufferedMatrix in R Universe. | ||||||||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.75.0 |
| Command: /home/biocbuild/bbs-3.24-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.24-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz |
| StartedAt: 2026-04-26 21:42:15 -0400 (Sun, 26 Apr 2026) |
| EndedAt: 2026-04-26 21:42:39 -0400 (Sun, 26 Apr 2026) |
| EllapsedTime: 24.1 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.24-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.24-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.6.0 RC (2026-04-17 r89917)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
* running under: Ubuntu 24.04.4 LTS
* using session charset: UTF-8
* current time: 2026-04-27 01:42:16 UTC
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE
Status: 1 NOTE
See
‘/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.24-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.24-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.24-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.24-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
1580 | if (!(Matrix->readonly) & setting){
| ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
3327 | static int sort_double(const double *a1,const double *a2){
| ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.24-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.24-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.24-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.24-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.24-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.262 0.039 0.291
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 480233 25.7 1053308 56.3 637571 34.1
Vcells 887253 6.8 8388608 64.0 2083896 15.9
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Sun Apr 26 21:42:31 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Sun Apr 26 21:42:31 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: 0x5f7598699520>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Sun Apr 26 21:42:31 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Sun Apr 26 21:42:31 2026"
>
> ColMode(tmp2)
<pointer: 0x5f7598699520>
>
>
>
> ### 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.3836234 0.2037827 0.4767178 0.03898162
[2,] 0.2293504 -2.0418387 0.5813396 -0.16752863
[3,] 1.8435500 0.3408880 0.1563118 -1.79377003
[4,] -1.9749079 0.4215755 0.6848674 0.35776604
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 99.3836234 0.2037827 0.4767178 0.03898162
[2,] 0.2293504 2.0418387 0.5813396 0.16752863
[3,] 1.8435500 0.3408880 0.1563118 1.79377003
[4,] 1.9749079 0.4215755 0.6848674 0.35776604
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 9.9691335 0.4514230 0.6904475 0.1974376
[2,] 0.4789055 1.4289292 0.7624563 0.4093026
[3,] 1.3577739 0.5838562 0.3953628 1.3393170
[4,] 1.4053142 0.6492885 0.8275672 0.5981355
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 224.07496 29.71801 32.38119 27.01336
[2,] 30.01840 41.33113 33.20590 29.26055
[3,] 40.42129 31.17945 29.10994 40.18694
[4,] 41.02805 31.91446 33.96054 31.33912
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5f7599e929d0>
> exp(tmp5)
<pointer: 0x5f7599e929d0>
> log(tmp5,2)
<pointer: 0x5f7599e929d0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 466.3827
> Min(tmp5)
[1] 53.93352
> mean(tmp5)
[1] 72.74274
> Sum(tmp5)
[1] 14548.55
> Var(tmp5)
[1] 855.2987
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.20029 73.75512 71.81375 68.82420 70.02592 70.19587 72.04774 69.67010
[9] 67.24418 72.65028
> rowSums(tmp5)
[1] 1824.006 1475.102 1436.275 1376.484 1400.518 1403.917 1440.955 1393.402
[9] 1344.884 1453.006
> rowVars(tmp5)
[1] 7847.16908 99.96520 66.04141 56.50222 44.82986 89.56946
[7] 68.05055 84.32910 62.77327 105.25833
> rowSd(tmp5)
[1] 88.584248 9.998260 8.126587 7.516796 6.695510 9.464114 8.249276
[8] 9.183088 7.922958 10.259548
> rowMax(tmp5)
[1] 466.38267 86.63076 84.69624 85.39451 78.86021 90.89375 82.11396
[8] 84.95660 86.29190 92.29882
> rowMin(tmp5)
[1] 56.22477 60.27016 58.29054 57.32350 59.67333 59.26293 53.93352 54.65007
[9] 56.05396 54.25903
>
> colMeans(tmp5)
[1] 110.99646 68.12604 67.93517 70.88480 71.22531 72.94623 67.43668
[8] 68.62955 75.29316 69.21270 74.57811 73.41666 69.10267 70.80465
[15] 69.57210 67.92198 72.23811 74.36032 69.98100 70.19319
> colSums(tmp5)
[1] 1109.9646 681.2604 679.3517 708.8480 712.2531 729.4623 674.3668
[8] 686.2955 752.9316 692.1270 745.7811 734.1666 691.0267 708.0465
[15] 695.7210 679.2198 722.3811 743.6032 699.8100 701.9319
> colVars(tmp5)
[1] 15690.64020 64.60783 84.14370 105.88347 45.13657 67.92084
[7] 44.34138 45.89768 117.82484 67.77032 65.07509 61.91082
[13] 99.95949 102.67985 72.58911 73.78938 47.71608 39.30493
[19] 89.57317 92.92029
> colSd(tmp5)
[1] 125.262286 8.037900 9.172988 10.289969 6.718375 8.241410
[7] 6.658933 6.774783 10.854715 8.232273 8.066913 7.868343
[13] 9.997974 10.133106 8.519924 8.590075 6.907682 6.269364
[19] 9.464310 9.639517
> colMax(tmp5)
[1] 466.38267 86.02533 87.95025 88.91349 81.14730 85.58809 78.18939
[8] 77.25405 92.29882 80.50134 86.63076 83.97525 83.91602 86.29190
[15] 85.00793 81.66501 81.18214 82.11396 88.20389 85.83715
> colMin(tmp5)
[1] 59.67333 58.55010 53.93352 56.22477 62.73296 57.32350 57.01203 58.19872
[9] 61.24949 57.37767 63.19260 59.02091 56.05396 60.27016 54.65007 54.25903
[17] 61.31316 62.59187 58.29054 59.61928
>
>
> ### 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.20029 73.75512 NA 68.82420 70.02592 70.19587 72.04774 69.67010
[9] 67.24418 72.65028
> rowSums(tmp5)
[1] 1824.006 1475.102 NA 1376.484 1400.518 1403.917 1440.955 1393.402
[9] 1344.884 1453.006
> rowVars(tmp5)
[1] 7847.16908 99.96520 61.52609 56.50222 44.82986 89.56946
[7] 68.05055 84.32910 62.77327 105.25833
> rowSd(tmp5)
[1] 88.584248 9.998260 7.843857 7.516796 6.695510 9.464114 8.249276
[8] 9.183088 7.922958 10.259548
> rowMax(tmp5)
[1] 466.38267 86.63076 NA 85.39451 78.86021 90.89375 82.11396
[8] 84.95660 86.29190 92.29882
> rowMin(tmp5)
[1] 56.22477 60.27016 NA 57.32350 59.67333 59.26293 53.93352 54.65007
[9] 56.05396 54.25903
>
> colMeans(tmp5)
[1] 110.99646 68.12604 67.93517 NA 71.22531 72.94623 67.43668
[8] 68.62955 75.29316 69.21270 74.57811 73.41666 69.10267 70.80465
[15] 69.57210 67.92198 72.23811 74.36032 69.98100 70.19319
> colSums(tmp5)
[1] 1109.9646 681.2604 679.3517 NA 712.2531 729.4623 674.3668
[8] 686.2955 752.9316 692.1270 745.7811 734.1666 691.0267 708.0465
[15] 695.7210 679.2198 722.3811 743.6032 699.8100 701.9319
> colVars(tmp5)
[1] 15690.64020 64.60783 84.14370 NA 45.13657 67.92084
[7] 44.34138 45.89768 117.82484 67.77032 65.07509 61.91082
[13] 99.95949 102.67985 72.58911 73.78938 47.71608 39.30493
[19] 89.57317 92.92029
> colSd(tmp5)
[1] 125.262286 8.037900 9.172988 NA 6.718375 8.241410
[7] 6.658933 6.774783 10.854715 8.232273 8.066913 7.868343
[13] 9.997974 10.133106 8.519924 8.590075 6.907682 6.269364
[19] 9.464310 9.639517
> colMax(tmp5)
[1] 466.38267 86.02533 87.95025 NA 81.14730 85.58809 78.18939
[8] 77.25405 92.29882 80.50134 86.63076 83.97525 83.91602 86.29190
[15] 85.00793 81.66501 81.18214 82.11396 88.20389 85.83715
> colMin(tmp5)
[1] 59.67333 58.55010 53.93352 NA 62.73296 57.32350 57.01203 58.19872
[9] 61.24949 57.37767 63.19260 59.02091 56.05396 60.27016 54.65007 54.25903
[17] 61.31316 62.59187 58.29054 59.61928
>
> Max(tmp5,na.rm=TRUE)
[1] 466.3827
> Min(tmp5,na.rm=TRUE)
[1] 53.93352
> mean(tmp5,na.rm=TRUE)
[1] 72.68797
> Sum(tmp5,na.rm=TRUE)
[1] 14464.91
> Var(tmp5,na.rm=TRUE)
[1] 859.0152
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.20029 73.75512 71.19111 68.82420 70.02592 70.19587 72.04774 69.67010
[9] 67.24418 72.65028
> rowSums(tmp5,na.rm=TRUE)
[1] 1824.006 1475.102 1352.631 1376.484 1400.518 1403.917 1440.955 1393.402
[9] 1344.884 1453.006
> rowVars(tmp5,na.rm=TRUE)
[1] 7847.16908 99.96520 61.52609 56.50222 44.82986 89.56946
[7] 68.05055 84.32910 62.77327 105.25833
> rowSd(tmp5,na.rm=TRUE)
[1] 88.584248 9.998260 7.843857 7.516796 6.695510 9.464114 8.249276
[8] 9.183088 7.922958 10.259548
> rowMax(tmp5,na.rm=TRUE)
[1] 466.38267 86.63076 84.69624 85.39451 78.86021 90.89375 82.11396
[8] 84.95660 86.29190 92.29882
> rowMin(tmp5,na.rm=TRUE)
[1] 56.22477 60.27016 58.29054 57.32350 59.67333 59.26293 53.93352 54.65007
[9] 56.05396 54.25903
>
> colMeans(tmp5,na.rm=TRUE)
[1] 110.99646 68.12604 67.93517 69.46713 71.22531 72.94623 67.43668
[8] 68.62955 75.29316 69.21270 74.57811 73.41666 69.10267 70.80465
[15] 69.57210 67.92198 72.23811 74.36032 69.98100 70.19319
> colSums(tmp5,na.rm=TRUE)
[1] 1109.9646 681.2604 679.3517 625.2042 712.2531 729.4623 674.3668
[8] 686.2955 752.9316 692.1270 745.7811 734.1666 691.0267 708.0465
[15] 695.7210 679.2198 722.3811 743.6032 699.8100 701.9319
> colVars(tmp5,na.rm=TRUE)
[1] 15690.64020 64.60783 84.14370 96.50873 45.13657 67.92084
[7] 44.34138 45.89768 117.82484 67.77032 65.07509 61.91082
[13] 99.95949 102.67985 72.58911 73.78938 47.71608 39.30493
[19] 89.57317 92.92029
> colSd(tmp5,na.rm=TRUE)
[1] 125.262286 8.037900 9.172988 9.823885 6.718375 8.241410
[7] 6.658933 6.774783 10.854715 8.232273 8.066913 7.868343
[13] 9.997974 10.133106 8.519924 8.590075 6.907682 6.269364
[19] 9.464310 9.639517
> colMax(tmp5,na.rm=TRUE)
[1] 466.38267 86.02533 87.95025 88.91349 81.14730 85.58809 78.18939
[8] 77.25405 92.29882 80.50134 86.63076 83.97525 83.91602 86.29190
[15] 85.00793 81.66501 81.18214 82.11396 88.20389 85.83715
> colMin(tmp5,na.rm=TRUE)
[1] 59.67333 58.55010 53.93352 56.22477 62.73296 57.32350 57.01203 58.19872
[9] 61.24949 57.37767 63.19260 59.02091 56.05396 60.27016 54.65007 54.25903
[17] 61.31316 62.59187 58.29054 59.61928
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.20029 73.75512 NaN 68.82420 70.02592 70.19587 72.04774 69.67010
[9] 67.24418 72.65028
> rowSums(tmp5,na.rm=TRUE)
[1] 1824.006 1475.102 0.000 1376.484 1400.518 1403.917 1440.955 1393.402
[9] 1344.884 1453.006
> rowVars(tmp5,na.rm=TRUE)
[1] 7847.16908 99.96520 NA 56.50222 44.82986 89.56946
[7] 68.05055 84.32910 62.77327 105.25833
> rowSd(tmp5,na.rm=TRUE)
[1] 88.584248 9.998260 NA 7.516796 6.695510 9.464114 8.249276
[8] 9.183088 7.922958 10.259548
> rowMax(tmp5,na.rm=TRUE)
[1] 466.38267 86.63076 NA 85.39451 78.86021 90.89375 82.11396
[8] 84.95660 86.29190 92.29882
> rowMin(tmp5,na.rm=TRUE)
[1] 56.22477 60.27016 NA 57.32350 59.67333 59.26293 53.93352 54.65007
[9] 56.05396 54.25903
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 113.98144 68.48495 68.75146 NaN 71.14635 72.20473 67.25673
[8] 69.44295 76.34178 68.75669 74.79322 73.26390 68.55579 69.26114
[15] 69.15611 68.68217 72.73104 73.77555 71.27994 69.58627
> colSums(tmp5,na.rm=TRUE)
[1] 1025.8330 616.3645 618.7631 0.0000 640.3171 649.8426 605.3105
[8] 624.9866 687.0760 618.8102 673.1390 659.3751 617.0021 623.3502
[15] 622.4050 618.1395 654.5794 663.9800 641.5194 626.2765
> colVars(tmp5,na.rm=TRUE)
[1] 17551.73136 71.23470 87.16540 NA 50.70848 70.22546
[7] 49.51974 44.19169 120.18243 73.90222 72.68892 69.38717
[13] 109.08983 88.71256 79.71595 76.51183 50.94709 40.37106
[19] 81.78831 100.39144
> colSd(tmp5,na.rm=TRUE)
[1] 132.482947 8.440065 9.336241 NA 7.120989 8.380063
[7] 7.037026 6.647683 10.962775 8.596640 8.525780 8.329896
[13] 10.444608 9.418735 8.928379 8.747104 7.137723 6.353823
[19] 9.043689 10.019553
> colMax(tmp5,na.rm=TRUE)
[1] 466.38267 86.02533 87.95025 -Inf 81.14730 85.58809 78.18939
[8] 77.25405 92.29882 80.50134 86.63076 83.97525 83.91602 86.29190
[15] 85.00793 81.66501 81.18214 82.11396 88.20389 85.83715
> colMin(tmp5,na.rm=TRUE)
[1] 59.67333 58.55010 53.93352 Inf 62.73296 57.32350 57.01203 58.19872
[9] 61.24949 57.37767 63.19260 59.02091 56.05396 60.27016 54.65007 54.25903
[17] 61.31316 62.59187 60.59752 59.61928
>
>
>
>
> 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] 347.9014 137.1832 274.2229 104.3348 320.1280 323.6630 246.3427 145.0447
[9] 289.4400 124.1164
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 347.9014 137.1832 274.2229 104.3348 320.1280 323.6630 246.3427 145.0447
[9] 289.4400 124.1164
>
>
>
> 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 8.526513e-14 -2.842171e-14 1.136868e-13 -2.842171e-14
[6] 2.842171e-14 -8.526513e-14 1.421085e-14 -1.421085e-13 -2.273737e-13
[11] -2.842171e-14 5.684342e-14 1.136868e-13 -2.842171e-14 -1.136868e-13
[16] 2.842171e-14 1.421085e-13 -8.526513e-14 0.000000e+00 5.684342e-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)
+ }
6 1
7 13
3 18
9 19
7 5
7 2
10 6
2 2
7 2
1 8
1 17
6 13
5 2
4 20
9 19
1 1
10 12
7 2
9 8
7 14
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 2.187089
> Min(tmp)
[1] -2.331776
> mean(tmp)
[1] -0.03241147
> Sum(tmp)
[1] -3.241147
> Var(tmp)
[1] 0.9074653
>
> rowMeans(tmp)
[1] -0.03241147
> rowSums(tmp)
[1] -3.241147
> rowVars(tmp)
[1] 0.9074653
> rowSd(tmp)
[1] 0.9526097
> rowMax(tmp)
[1] 2.187089
> rowMin(tmp)
[1] -2.331776
>
> colMeans(tmp)
[1] 0.93942361 -2.33177610 -1.30786068 -0.84869915 0.75317168 -1.78666265
[7] 1.23604005 0.65637369 -0.40279472 0.10061206 -0.95155509 0.44976902
[13] -1.94232877 1.15373837 -1.67422816 0.16595642 -0.03706249 0.59424532
[19] -0.32263324 -0.92598291 -1.63139024 -0.24036703 1.21274549 0.68202761
[25] -0.01808678 1.65883379 0.72546033 0.21633968 -0.76498358 0.49119999
[31] -0.63790186 1.74473708 -0.77868528 0.72717132 -1.29080496 1.11026089
[37] -1.15185001 0.56986302 1.39663889 0.79705805 0.15650738 0.71381416
[43] -0.86348445 -0.07464443 -0.76588130 -0.59882423 -0.79889442 -0.27156008
[49] 1.25350304 -0.42626520 -0.20266342 -0.80536442 1.34170281 1.16428185
[55] -0.02547833 0.25379375 1.45295481 -0.38792736 0.53741819 0.32758459
[61] -1.76149068 0.33123872 -0.30493394 -0.96799530 -0.77598715 0.72635717
[67] 0.53916997 0.39183973 -0.36262588 -1.16011476 -0.79823034 -0.21883614
[73] -0.23055455 -1.05704461 -0.96203398 -0.98749530 0.71146810 -0.26970614
[79] -0.63070770 -1.34656356 -0.85339637 0.15882924 1.22661480 1.15832453
[85] 1.69863560 0.86503447 2.18708888 -0.33296859 0.26282035 -0.11125618
[91] 0.98013553 -1.05736565 -1.13848001 -0.37154506 -0.11301666 -0.15715499
[97] 1.79681148 -0.16492662 0.08133064 -0.53900183
> colSums(tmp)
[1] 0.93942361 -2.33177610 -1.30786068 -0.84869915 0.75317168 -1.78666265
[7] 1.23604005 0.65637369 -0.40279472 0.10061206 -0.95155509 0.44976902
[13] -1.94232877 1.15373837 -1.67422816 0.16595642 -0.03706249 0.59424532
[19] -0.32263324 -0.92598291 -1.63139024 -0.24036703 1.21274549 0.68202761
[25] -0.01808678 1.65883379 0.72546033 0.21633968 -0.76498358 0.49119999
[31] -0.63790186 1.74473708 -0.77868528 0.72717132 -1.29080496 1.11026089
[37] -1.15185001 0.56986302 1.39663889 0.79705805 0.15650738 0.71381416
[43] -0.86348445 -0.07464443 -0.76588130 -0.59882423 -0.79889442 -0.27156008
[49] 1.25350304 -0.42626520 -0.20266342 -0.80536442 1.34170281 1.16428185
[55] -0.02547833 0.25379375 1.45295481 -0.38792736 0.53741819 0.32758459
[61] -1.76149068 0.33123872 -0.30493394 -0.96799530 -0.77598715 0.72635717
[67] 0.53916997 0.39183973 -0.36262588 -1.16011476 -0.79823034 -0.21883614
[73] -0.23055455 -1.05704461 -0.96203398 -0.98749530 0.71146810 -0.26970614
[79] -0.63070770 -1.34656356 -0.85339637 0.15882924 1.22661480 1.15832453
[85] 1.69863560 0.86503447 2.18708888 -0.33296859 0.26282035 -0.11125618
[91] 0.98013553 -1.05736565 -1.13848001 -0.37154506 -0.11301666 -0.15715499
[97] 1.79681148 -0.16492662 0.08133064 -0.53900183
> 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.93942361 -2.33177610 -1.30786068 -0.84869915 0.75317168 -1.78666265
[7] 1.23604005 0.65637369 -0.40279472 0.10061206 -0.95155509 0.44976902
[13] -1.94232877 1.15373837 -1.67422816 0.16595642 -0.03706249 0.59424532
[19] -0.32263324 -0.92598291 -1.63139024 -0.24036703 1.21274549 0.68202761
[25] -0.01808678 1.65883379 0.72546033 0.21633968 -0.76498358 0.49119999
[31] -0.63790186 1.74473708 -0.77868528 0.72717132 -1.29080496 1.11026089
[37] -1.15185001 0.56986302 1.39663889 0.79705805 0.15650738 0.71381416
[43] -0.86348445 -0.07464443 -0.76588130 -0.59882423 -0.79889442 -0.27156008
[49] 1.25350304 -0.42626520 -0.20266342 -0.80536442 1.34170281 1.16428185
[55] -0.02547833 0.25379375 1.45295481 -0.38792736 0.53741819 0.32758459
[61] -1.76149068 0.33123872 -0.30493394 -0.96799530 -0.77598715 0.72635717
[67] 0.53916997 0.39183973 -0.36262588 -1.16011476 -0.79823034 -0.21883614
[73] -0.23055455 -1.05704461 -0.96203398 -0.98749530 0.71146810 -0.26970614
[79] -0.63070770 -1.34656356 -0.85339637 0.15882924 1.22661480 1.15832453
[85] 1.69863560 0.86503447 2.18708888 -0.33296859 0.26282035 -0.11125618
[91] 0.98013553 -1.05736565 -1.13848001 -0.37154506 -0.11301666 -0.15715499
[97] 1.79681148 -0.16492662 0.08133064 -0.53900183
> colMin(tmp)
[1] 0.93942361 -2.33177610 -1.30786068 -0.84869915 0.75317168 -1.78666265
[7] 1.23604005 0.65637369 -0.40279472 0.10061206 -0.95155509 0.44976902
[13] -1.94232877 1.15373837 -1.67422816 0.16595642 -0.03706249 0.59424532
[19] -0.32263324 -0.92598291 -1.63139024 -0.24036703 1.21274549 0.68202761
[25] -0.01808678 1.65883379 0.72546033 0.21633968 -0.76498358 0.49119999
[31] -0.63790186 1.74473708 -0.77868528 0.72717132 -1.29080496 1.11026089
[37] -1.15185001 0.56986302 1.39663889 0.79705805 0.15650738 0.71381416
[43] -0.86348445 -0.07464443 -0.76588130 -0.59882423 -0.79889442 -0.27156008
[49] 1.25350304 -0.42626520 -0.20266342 -0.80536442 1.34170281 1.16428185
[55] -0.02547833 0.25379375 1.45295481 -0.38792736 0.53741819 0.32758459
[61] -1.76149068 0.33123872 -0.30493394 -0.96799530 -0.77598715 0.72635717
[67] 0.53916997 0.39183973 -0.36262588 -1.16011476 -0.79823034 -0.21883614
[73] -0.23055455 -1.05704461 -0.96203398 -0.98749530 0.71146810 -0.26970614
[79] -0.63070770 -1.34656356 -0.85339637 0.15882924 1.22661480 1.15832453
[85] 1.69863560 0.86503447 2.18708888 -0.33296859 0.26282035 -0.11125618
[91] 0.98013553 -1.05736565 -1.13848001 -0.37154506 -0.11301666 -0.15715499
[97] 1.79681148 -0.16492662 0.08133064 -0.53900183
> colMedians(tmp)
[1] 0.93942361 -2.33177610 -1.30786068 -0.84869915 0.75317168 -1.78666265
[7] 1.23604005 0.65637369 -0.40279472 0.10061206 -0.95155509 0.44976902
[13] -1.94232877 1.15373837 -1.67422816 0.16595642 -0.03706249 0.59424532
[19] -0.32263324 -0.92598291 -1.63139024 -0.24036703 1.21274549 0.68202761
[25] -0.01808678 1.65883379 0.72546033 0.21633968 -0.76498358 0.49119999
[31] -0.63790186 1.74473708 -0.77868528 0.72717132 -1.29080496 1.11026089
[37] -1.15185001 0.56986302 1.39663889 0.79705805 0.15650738 0.71381416
[43] -0.86348445 -0.07464443 -0.76588130 -0.59882423 -0.79889442 -0.27156008
[49] 1.25350304 -0.42626520 -0.20266342 -0.80536442 1.34170281 1.16428185
[55] -0.02547833 0.25379375 1.45295481 -0.38792736 0.53741819 0.32758459
[61] -1.76149068 0.33123872 -0.30493394 -0.96799530 -0.77598715 0.72635717
[67] 0.53916997 0.39183973 -0.36262588 -1.16011476 -0.79823034 -0.21883614
[73] -0.23055455 -1.05704461 -0.96203398 -0.98749530 0.71146810 -0.26970614
[79] -0.63070770 -1.34656356 -0.85339637 0.15882924 1.22661480 1.15832453
[85] 1.69863560 0.86503447 2.18708888 -0.33296859 0.26282035 -0.11125618
[91] 0.98013553 -1.05736565 -1.13848001 -0.37154506 -0.11301666 -0.15715499
[97] 1.79681148 -0.16492662 0.08133064 -0.53900183
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.9394236 -2.331776 -1.307861 -0.8486992 0.7531717 -1.786663 1.23604
[2,] 0.9394236 -2.331776 -1.307861 -0.8486992 0.7531717 -1.786663 1.23604
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.6563737 -0.4027947 0.1006121 -0.9515551 0.449769 -1.942329 1.153738
[2,] 0.6563737 -0.4027947 0.1006121 -0.9515551 0.449769 -1.942329 1.153738
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -1.674228 0.1659564 -0.03706249 0.5942453 -0.3226332 -0.9259829 -1.63139
[2,] -1.674228 0.1659564 -0.03706249 0.5942453 -0.3226332 -0.9259829 -1.63139
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.240367 1.212745 0.6820276 -0.01808678 1.658834 0.7254603 0.2163397
[2,] -0.240367 1.212745 0.6820276 -0.01808678 1.658834 0.7254603 0.2163397
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.7649836 0.4912 -0.6379019 1.744737 -0.7786853 0.7271713 -1.290805
[2,] -0.7649836 0.4912 -0.6379019 1.744737 -0.7786853 0.7271713 -1.290805
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 1.110261 -1.15185 0.569863 1.396639 0.7970581 0.1565074 0.7138142
[2,] 1.110261 -1.15185 0.569863 1.396639 0.7970581 0.1565074 0.7138142
[,43] [,44] [,45] [,46] [,47] [,48]
[1,] -0.8634845 -0.07464443 -0.7658813 -0.5988242 -0.7988944 -0.2715601
[2,] -0.8634845 -0.07464443 -0.7658813 -0.5988242 -0.7988944 -0.2715601
[,49] [,50] [,51] [,52] [,53] [,54] [,55]
[1,] 1.253503 -0.4262652 -0.2026634 -0.8053644 1.341703 1.164282 -0.02547833
[2,] 1.253503 -0.4262652 -0.2026634 -0.8053644 1.341703 1.164282 -0.02547833
[,56] [,57] [,58] [,59] [,60] [,61] [,62]
[1,] 0.2537938 1.452955 -0.3879274 0.5374182 0.3275846 -1.761491 0.3312387
[2,] 0.2537938 1.452955 -0.3879274 0.5374182 0.3275846 -1.761491 0.3312387
[,63] [,64] [,65] [,66] [,67] [,68] [,69]
[1,] -0.3049339 -0.9679953 -0.7759871 0.7263572 0.53917 0.3918397 -0.3626259
[2,] -0.3049339 -0.9679953 -0.7759871 0.7263572 0.53917 0.3918397 -0.3626259
[,70] [,71] [,72] [,73] [,74] [,75] [,76]
[1,] -1.160115 -0.7982303 -0.2188361 -0.2305546 -1.057045 -0.962034 -0.9874953
[2,] -1.160115 -0.7982303 -0.2188361 -0.2305546 -1.057045 -0.962034 -0.9874953
[,77] [,78] [,79] [,80] [,81] [,82] [,83]
[1,] 0.7114681 -0.2697061 -0.6307077 -1.346564 -0.8533964 0.1588292 1.226615
[2,] 0.7114681 -0.2697061 -0.6307077 -1.346564 -0.8533964 0.1588292 1.226615
[,84] [,85] [,86] [,87] [,88] [,89] [,90]
[1,] 1.158325 1.698636 0.8650345 2.187089 -0.3329686 0.2628203 -0.1112562
[2,] 1.158325 1.698636 0.8650345 2.187089 -0.3329686 0.2628203 -0.1112562
[,91] [,92] [,93] [,94] [,95] [,96] [,97]
[1,] 0.9801355 -1.057366 -1.13848 -0.3715451 -0.1130167 -0.157155 1.796811
[2,] 0.9801355 -1.057366 -1.13848 -0.3715451 -0.1130167 -0.157155 1.796811
[,98] [,99] [,100]
[1,] -0.1649266 0.08133064 -0.5390018
[2,] -0.1649266 0.08133064 -0.5390018
>
>
> Max(tmp2)
[1] 1.914189
> Min(tmp2)
[1] -1.963255
> mean(tmp2)
[1] -0.132069
> Sum(tmp2)
[1] -13.2069
> Var(tmp2)
[1] 0.7492697
>
> rowMeans(tmp2)
[1] 1.74095849 0.53998219 -0.66500134 -0.14280491 -0.14737826 -0.62635298
[7] -0.40580252 -1.57968185 -0.68762325 -0.55462988 0.89251259 0.43410379
[13] -0.53803387 0.30687969 1.91021762 0.01181312 0.32166536 1.75280056
[19] -1.46123361 -0.93392499 -1.37709070 -0.79411204 -0.35714300 -0.35240490
[25] -0.71326310 0.57898852 0.63363252 -1.18073276 -0.42783674 0.41096693
[31] -1.81435184 0.21631613 0.61697100 -0.23443958 0.34972488 1.21586828
[37] -0.20237423 0.13830503 -1.11113554 0.35800062 0.93356746 1.39463336
[43] -1.73567109 -0.27383860 -1.14580625 0.35978649 0.57294515 -1.80623194
[49] 0.19280433 0.72377692 -1.52842288 -0.90621849 -0.75389792 -0.33136770
[55] 1.50500236 0.86939300 -1.03827630 0.07476133 -0.22575218 0.18042999
[61] -0.78870375 -0.70512546 0.94503627 0.74993814 0.97086900 -0.18403783
[67] -0.86616156 -1.11836621 -0.36945677 -0.26111875 -0.08822245 -0.57155355
[73] -0.35052310 0.06110753 0.94711709 0.43998852 -0.26483047 0.02157253
[79] 0.44792960 -0.22468202 1.27220431 -0.09217403 -0.21176013 -1.07023595
[85] 1.91418867 -0.42058947 -0.63748609 -0.82666162 -1.57067946 -1.19343201
[91] -0.19543991 -1.96325527 0.29798158 -0.23986291 -0.95882985 0.55541766
[97] -0.22372625 0.50981110 0.19834542 -0.32546481
> rowSums(tmp2)
[1] 1.74095849 0.53998219 -0.66500134 -0.14280491 -0.14737826 -0.62635298
[7] -0.40580252 -1.57968185 -0.68762325 -0.55462988 0.89251259 0.43410379
[13] -0.53803387 0.30687969 1.91021762 0.01181312 0.32166536 1.75280056
[19] -1.46123361 -0.93392499 -1.37709070 -0.79411204 -0.35714300 -0.35240490
[25] -0.71326310 0.57898852 0.63363252 -1.18073276 -0.42783674 0.41096693
[31] -1.81435184 0.21631613 0.61697100 -0.23443958 0.34972488 1.21586828
[37] -0.20237423 0.13830503 -1.11113554 0.35800062 0.93356746 1.39463336
[43] -1.73567109 -0.27383860 -1.14580625 0.35978649 0.57294515 -1.80623194
[49] 0.19280433 0.72377692 -1.52842288 -0.90621849 -0.75389792 -0.33136770
[55] 1.50500236 0.86939300 -1.03827630 0.07476133 -0.22575218 0.18042999
[61] -0.78870375 -0.70512546 0.94503627 0.74993814 0.97086900 -0.18403783
[67] -0.86616156 -1.11836621 -0.36945677 -0.26111875 -0.08822245 -0.57155355
[73] -0.35052310 0.06110753 0.94711709 0.43998852 -0.26483047 0.02157253
[79] 0.44792960 -0.22468202 1.27220431 -0.09217403 -0.21176013 -1.07023595
[85] 1.91418867 -0.42058947 -0.63748609 -0.82666162 -1.57067946 -1.19343201
[91] -0.19543991 -1.96325527 0.29798158 -0.23986291 -0.95882985 0.55541766
[97] -0.22372625 0.50981110 0.19834542 -0.32546481
> 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] 1.74095849 0.53998219 -0.66500134 -0.14280491 -0.14737826 -0.62635298
[7] -0.40580252 -1.57968185 -0.68762325 -0.55462988 0.89251259 0.43410379
[13] -0.53803387 0.30687969 1.91021762 0.01181312 0.32166536 1.75280056
[19] -1.46123361 -0.93392499 -1.37709070 -0.79411204 -0.35714300 -0.35240490
[25] -0.71326310 0.57898852 0.63363252 -1.18073276 -0.42783674 0.41096693
[31] -1.81435184 0.21631613 0.61697100 -0.23443958 0.34972488 1.21586828
[37] -0.20237423 0.13830503 -1.11113554 0.35800062 0.93356746 1.39463336
[43] -1.73567109 -0.27383860 -1.14580625 0.35978649 0.57294515 -1.80623194
[49] 0.19280433 0.72377692 -1.52842288 -0.90621849 -0.75389792 -0.33136770
[55] 1.50500236 0.86939300 -1.03827630 0.07476133 -0.22575218 0.18042999
[61] -0.78870375 -0.70512546 0.94503627 0.74993814 0.97086900 -0.18403783
[67] -0.86616156 -1.11836621 -0.36945677 -0.26111875 -0.08822245 -0.57155355
[73] -0.35052310 0.06110753 0.94711709 0.43998852 -0.26483047 0.02157253
[79] 0.44792960 -0.22468202 1.27220431 -0.09217403 -0.21176013 -1.07023595
[85] 1.91418867 -0.42058947 -0.63748609 -0.82666162 -1.57067946 -1.19343201
[91] -0.19543991 -1.96325527 0.29798158 -0.23986291 -0.95882985 0.55541766
[97] -0.22372625 0.50981110 0.19834542 -0.32546481
> rowMin(tmp2)
[1] 1.74095849 0.53998219 -0.66500134 -0.14280491 -0.14737826 -0.62635298
[7] -0.40580252 -1.57968185 -0.68762325 -0.55462988 0.89251259 0.43410379
[13] -0.53803387 0.30687969 1.91021762 0.01181312 0.32166536 1.75280056
[19] -1.46123361 -0.93392499 -1.37709070 -0.79411204 -0.35714300 -0.35240490
[25] -0.71326310 0.57898852 0.63363252 -1.18073276 -0.42783674 0.41096693
[31] -1.81435184 0.21631613 0.61697100 -0.23443958 0.34972488 1.21586828
[37] -0.20237423 0.13830503 -1.11113554 0.35800062 0.93356746 1.39463336
[43] -1.73567109 -0.27383860 -1.14580625 0.35978649 0.57294515 -1.80623194
[49] 0.19280433 0.72377692 -1.52842288 -0.90621849 -0.75389792 -0.33136770
[55] 1.50500236 0.86939300 -1.03827630 0.07476133 -0.22575218 0.18042999
[61] -0.78870375 -0.70512546 0.94503627 0.74993814 0.97086900 -0.18403783
[67] -0.86616156 -1.11836621 -0.36945677 -0.26111875 -0.08822245 -0.57155355
[73] -0.35052310 0.06110753 0.94711709 0.43998852 -0.26483047 0.02157253
[79] 0.44792960 -0.22468202 1.27220431 -0.09217403 -0.21176013 -1.07023595
[85] 1.91418867 -0.42058947 -0.63748609 -0.82666162 -1.57067946 -1.19343201
[91] -0.19543991 -1.96325527 0.29798158 -0.23986291 -0.95882985 0.55541766
[97] -0.22372625 0.50981110 0.19834542 -0.32546481
>
> colMeans(tmp2)
[1] -0.132069
> colSums(tmp2)
[1] -13.2069
> colVars(tmp2)
[1] 0.7492697
> colSd(tmp2)
[1] 0.8656037
> colMax(tmp2)
[1] 1.914189
> colMin(tmp2)
[1] -1.963255
> colMedians(tmp2)
[1] -0.2177432
> colRanges(tmp2)
[,1]
[1,] -1.963255
[2,] 1.914189
>
> 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] -5.8058323 -0.8077100 -0.3901894 -4.2674555 0.4122913 -0.5307109
[7] 4.9680513 -2.2623847 -3.6952638 0.2157952
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.7745358
[2,] -0.9746538
[3,] -0.6715912
[4,] -0.1490409
[5,] 0.6417159
>
> rowApply(tmp,sum)
[1] -0.6045864 1.7978881 -7.2641735 5.9049144 0.5350238 -2.8541325
[7] 1.2157960 -0.9133987 -3.4882899 -6.4924502
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 4 5 5 1 2 1 4 4 8 4
[2,] 6 3 9 6 4 2 7 10 5 5
[3,] 7 7 10 4 9 6 2 1 2 8
[4,] 5 4 1 5 1 9 5 5 9 2
[5,] 3 9 3 3 6 8 9 8 6 6
[6,] 10 2 6 7 5 5 1 7 4 7
[7,] 9 8 7 8 7 7 3 3 10 10
[8,] 1 6 2 9 10 10 6 2 1 3
[9,] 8 1 4 10 3 4 8 6 7 1
[10,] 2 10 8 2 8 3 10 9 3 9
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 2.8054993 -0.3375200 2.2071466 1.3590183 1.5714410 0.2885181
[7] -2.0509433 -3.4416672 2.1902423 2.3386726 1.1085305 -1.3120037
[13] 1.8581893 -0.1237977 1.8291886 0.5019668 0.2100747 -0.1609620
[19] 4.8529766 -2.3400544
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.70252377
[2,] -0.03673333
[3,] 0.23060880
[4,] 1.03031640
[5,] 2.28383123
>
> rowApply(tmp,sum)
[1] 1.11512138 5.18546363 1.76978840 5.37832858 -0.09418557
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 4 18 13 9 17
[2,] 11 16 17 1 1
[3,] 5 19 8 3 19
[4,] 18 8 1 19 13
[5,] 7 13 10 13 14
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.70252377 0.1098844 -0.62879453 1.23334829 -0.1845105 1.3722855
[2,] 2.28383123 1.0170725 2.44844956 -0.36010768 0.7480570 -1.1213004
[3,] 0.23060880 1.0149096 -0.04270371 -1.54438728 0.1201184 1.2710710
[4,] -0.03673333 -1.4060062 -0.78689057 1.94380600 0.5928434 -0.2164527
[5,] 1.03031640 -1.0733803 1.21708583 0.08635899 0.2949326 -1.0170853
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -2.3243732 -0.4587847 0.9083506 -1.0344044 1.1935138 0.7305261
[2,] -0.7456496 -1.9005830 0.9192041 0.4843087 0.7703361 -0.9229930
[3,] 1.5157877 -0.3514755 -0.2441417 1.0800056 0.2175459 0.1312901
[4,] -0.0196141 -0.5156615 -0.2010814 0.7092259 -0.1829486 -1.3219821
[5,] -0.4770940 -0.2151625 0.8079107 1.0995368 -0.8899166 0.0711552
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.4298510 0.3035379 -0.10807196 0.9880030 0.06390596 -0.05584501
[2,] 2.5237003 -0.1886577 1.75367920 -0.9143354 -0.32991941 -0.76313458
[3,] -1.4510458 0.4385190 0.04020481 -0.3241293 -0.57988877 0.65862810
[4,] 0.9583784 0.2714089 1.10889467 1.0402136 -0.48339280 0.02119671
[5,] -0.6026947 -0.9486058 -0.96551810 -0.2877851 1.53936973 -0.02180723
[,19] [,20]
[1,] 1.4047683 -2.1255453
[2,] -0.1102442 -0.4062501
[3,] 0.9559962 -1.3671247
[4,] 1.9599144 1.9432099
[5,] 0.6425419 -0.3843442
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 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.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 -0.2792848 -1.252138 -0.4300737 1.055256 0.08780874 0.06190883 0.5013013
col8 col9 col10 col11 col12 col13 col14
row1 -0.4134995 -0.655387 -0.4792902 0.2328179 -0.7065573 -0.2417207 -0.2934256
col15 col16 col17 col18 col19 col20
row1 0.2164009 -0.9255099 0.8388142 0.2375129 -0.4322685 1.168906
> tmp[,"col10"]
col10
row1 -0.4792902
row2 1.3232853
row3 -2.9019194
row4 0.2728157
row5 -1.8102662
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -0.2792848 -1.252138 -0.4300737 1.0552556 0.08780874 0.06190883
row5 -1.4875927 -0.100026 0.8454716 -0.4556394 -0.44318188 0.46769363
col7 col8 col9 col10 col11 col12 col13
row1 0.5013013 -0.4134995 -0.6553870 -0.4792902 0.2328179 -0.7065573 -0.2417207
row5 0.3285778 -0.3008817 -0.1564617 -1.8102662 0.1056006 0.0903611 -0.3852620
col14 col15 col16 col17 col18 col19
row1 -0.29342561 0.2164009 -0.9255099 0.8388142 0.2375129 -0.4322685
row5 -0.04314336 -1.9595902 0.5556619 1.7763604 -0.1307751 -0.8584019
col20
row1 1.1689062
row5 -0.5047701
> tmp[,c("col6","col20")]
col6 col20
row1 0.06190883 1.1689062
row2 0.29880715 1.0484455
row3 0.15407206 -0.6012499
row4 0.35867201 -0.4174782
row5 0.46769363 -0.5047701
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.06190883 1.1689062
row5 0.46769363 -0.5047701
>
>
>
>
> 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 48.05492 51.52968 50.07598 50.74531 48.72609 105.6316 52.31308 51.41017
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.16088 51.13927 51.76119 50.08209 50.58729 49.899 50.39605 48.87727
col17 col18 col19 col20
row1 50.86983 50.80522 51.16503 104.3892
> tmp[,"col10"]
col10
row1 51.13927
row2 28.51444
row3 30.20868
row4 28.86772
row5 50.20252
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.05492 51.52968 50.07598 50.74531 48.72609 105.6316 52.31308 51.41017
row5 50.30989 49.63983 51.62535 49.01319 48.84321 104.6522 49.82965 51.33840
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.16088 51.13927 51.76119 50.08209 50.58729 49.89900 50.39605 48.87727
row5 49.59121 50.20252 49.89896 49.60804 50.28036 49.37849 51.66870 48.81204
col17 col18 col19 col20
row1 50.86983 50.80522 51.16503 104.3892
row5 49.89670 51.12020 48.29849 105.6722
> tmp[,c("col6","col20")]
col6 col20
row1 105.63164 104.38922
row2 75.03870 73.97142
row3 75.34443 75.42421
row4 76.42038 75.20486
row5 104.65224 105.67217
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.6316 104.3892
row5 104.6522 105.6722
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.6316 104.3892
row5 104.6522 105.6722
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.2993494
[2,] -0.6248580
[3,] -1.9273157
[4,] 1.3367298
[5,] -0.8247344
> tmp[,c("col17","col7")]
col17 col7
[1,] -1.34908809 0.05535868
[2,] 0.69665304 0.59133235
[3,] 1.25137554 -0.03096054
[4,] -0.09089013 0.10218344
[5,] 0.05605819 1.81807282
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.8837290 -1.5427391
[2,] -1.0933856 0.3708817
[3,] 1.0479100 0.8905638
[4,] 0.7103973 1.0576687
[5,] -1.8006030 -1.2343518
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.883729
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.883729
[2,] -1.093386
>
>
>
> 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]
row3 -0.65581923 -1.1370422 -1.5793453 -1.084996 -1.337752 -0.48269900
row1 0.01210442 -0.6188891 -0.2228848 1.587948 0.812430 0.07440519
[,7] [,8] [,9] [,10] [,11] [,12]
row3 0.2355442 2.4649864 0.004048501 0.44904293 0.1951306 -0.9606350
row1 -0.4113510 -0.2865353 -0.303930486 -0.06894804 -1.6966261 0.4993246
[,13] [,14] [,15] [,16] [,17] [,18] [,19]
row3 0.5412621 1.1559315 1.2358053 -1.908786 -1.310214 -0.09574452 -0.3490250
row1 -0.6624064 0.3325703 0.5418258 1.724064 -0.662298 -0.02294034 -0.3507061
[,20]
row3 1.220597
row1 -1.496010
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 1.05542 1.007271 1.788688 -1.173862 -0.1434857 0.9623948 -0.2813499
[,8] [,9] [,10]
row2 1.091216 -0.191142 0.6506132
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.7352716 -0.2876111 -1.46654 -1.50699 1.362517 -0.4412997 1.044327
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 2.533549 0.1932136 0.2817185 2.201738 -0.9012928 0.7894908 0.359197
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.1350687 -0.3229983 0.8322661 -2.45027 -0.986867 -0.4182586
>
>
> 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: 0x5f759a0a0120>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d680066596a94"
[2] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d6800229032f9"
[3] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d6800fe9d4be"
[4] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d68006e92a6f0"
[5] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d68001aa5070e"
[6] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d680046ef77a5"
[7] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d680024bc49e2"
[8] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d680049ba345b"
[9] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d680046e513e9"
[10] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d680038c3b425"
[11] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d68002c39ab9e"
[12] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d68002a1b6c0e"
[13] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d680017344e69"
[14] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d680043d82653"
[15] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d68001ef8823d"
>
>
> ### 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: 0x5f759aa1eaa0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5f759aa1eaa0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5f759aa1eaa0>
> rowMedians(tmp)
[1] 0.405894295 0.111091852 0.217623417 -0.387373714 -0.116172891
[6] -0.583875760 -0.152935530 -0.033139740 0.035452857 -0.074973748
[11] 0.063414875 -0.007767639 0.128550007 -0.017215524 0.063739970
[16] -0.417115767 0.338177645 -0.135439674 -0.052595827 -0.024431045
[21] -0.087075100 -0.169807173 -0.064623902 0.643334573 -0.583289963
[26] -0.257379111 -0.353959633 0.401012365 -0.196991320 0.201510185
[31] 0.051711645 -0.556738850 -0.219697605 0.282642573 0.163421943
[36] 0.123988953 0.230107110 0.461624250 -0.265514191 0.234737063
[41] 0.269771150 -0.153746733 -0.245169655 -0.265206520 -0.252370308
[46] -0.009216925 0.450360280 0.461570352 0.124766611 0.183053664
[51] 0.436835166 0.421376372 -0.016112494 -0.292159347 -0.067180118
[56] -0.099657788 -0.415905750 -0.807016736 0.136077578 -0.388634596
[61] 0.185105588 -0.125159680 -0.412461070 -0.468762230 -0.548336030
[66] -0.174709557 0.223440050 0.177978639 0.127647239 0.396201699
[71] 0.704863410 0.232416550 -0.060606574 -0.517395819 0.392386185
[76] 0.235444684 -0.136541791 -0.303947700 -0.220233297 0.119750253
[81] 0.483040037 0.025608109 0.427560656 0.069245549 0.488714942
[86] 0.757206046 0.036472849 -0.220752418 0.434024930 0.254077635
[91] -0.075352133 -0.642181013 0.202591334 0.021460024 -0.162301464
[96] -0.467250073 -0.481805617 0.110885081 0.427755195 0.256323525
[101] 0.326274827 0.388989289 0.361767070 -0.312963433 0.246590461
[106] -0.467342654 0.419121901 -0.727075863 0.468676457 -0.544104164
[111] 0.598091481 0.391286741 -0.015401937 -0.075467019 -0.054549556
[116] 0.051048320 0.374886842 -0.179406339 0.452832571 0.393002944
[121] 0.163111441 -0.174412041 -0.058680741 -0.265869437 0.074324686
[126] 0.105641325 0.569795428 0.144807997 0.257874171 0.381467499
[131] 0.294989145 -0.777110506 0.374388887 0.344896638 0.482196711
[136] 0.119690027 0.275775944 -0.171433359 0.298647622 -0.168037317
[141] -0.112276073 0.074593989 -0.517530327 0.082215710 0.564452162
[146] 0.869787880 0.642395086 0.262033543 0.045900728 0.357762696
[151] -0.431966205 -0.253312080 0.351042757 -0.272421105 -0.249495913
[156] -0.360388479 0.299329451 0.753454060 0.204006003 -0.527473439
[161] 0.205991967 0.214481097 0.133332051 0.310550716 0.077499038
[166] -0.153595575 0.283350355 0.376442625 -0.344532715 -0.225321926
[171] 0.689834956 0.345052008 0.123035174 -0.118383707 -0.238023798
[176] 0.061777058 0.067655803 0.753879039 0.121915888 -0.284380546
[181] -0.143532960 0.426730532 -0.158962863 0.398597596 0.176290823
[186] -0.144541327 -0.318220242 0.616743951 -0.288799371 0.326981048
[191] 0.031945979 0.011645857 0.418350850 -0.065098278 -0.067387615
[196] -0.243445333 -0.078347474 0.155084390 -0.559125554 -0.191859858
[201] -0.303930165 -0.285699669 0.045144345 -0.082052581 -0.009008764
[206] 0.226170491 0.356510297 -0.077556208 -0.269045009 -0.359102540
[211] 0.182953004 0.031086469 -0.224887653 0.100747592 0.086700406
[216] 0.504021083 -0.084845877 -0.566586479 0.329446939 0.069153460
[221] 0.194583190 0.015588450 0.201551743 0.354336003 -0.459823433
[226] -0.055475982 -0.280811438 0.455574088 -0.199475541 -0.484377361
>
> proc.time()
user system elapsed
1.292 0.686 1.968
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: 0x5d36a194f520>
> .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: 0x5d36a194f520>
> .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: 0x5d36a194f520>
> .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: 0x5d36a194f520>
> 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: 0x5d36a14f8f60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5d36a14f8f60>
> .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: 0x5d36a14f8f60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5d36a14f8f60>
> .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: 0x5d36a14f8f60>
> 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: 0x5d36a20a2b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5d36a20a2b40>
> .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: 0x5d36a20a2b40>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5d36a20a2b40>
> .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: 0x5d36a20a2b40>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5d36a20a2b40>
> .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: 0x5d36a20a2b40>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5d36a20a2b40>
> .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: 0x5d36a20a2b40>
> 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: 0x5d36a20dfbc0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5d36a20dfbc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5d36a20dfbc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5d36a20dfbc0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1d68f611d718dc" "BufferedMatrixFile1d68f66f791173"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1d68f611d718dc" "BufferedMatrixFile1d68f66f791173"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5d36a3467de0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5d36a3467de0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5d36a3467de0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5d36a3467de0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5d36a3467de0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5d36a3467de0>
> .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: 0x5d36a119df80>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5d36a119df80>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5d36a119df80>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5d36a119df80>
> 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: 0x5d36a2138690>
> .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: 0x5d36a2138690>
> rm(P)
>
> proc.time()
user system elapsed
0.241 0.046 0.276
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.255 0.049 0.293