| Back to Build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-02-07 11:32 -0500 (Sat, 07 Feb 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences" | 4858 |
| 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 254/2347 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.3 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.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.75.0.tar.gz |
| StartedAt: 2026-02-06 21:46:58 -0500 (Fri, 06 Feb 2026) |
| EndedAt: 2026-02-06 21:47:23 -0500 (Fri, 06 Feb 2026) |
| EllapsedTime: 25.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2026-01-15 r89304)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* 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) 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.75.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 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 Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
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.246 0.048 0.280
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
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 478920 25.6 1048721 56.1 639242 34.2
Vcells 885815 6.8 8388608 64.0 2083259 15.9
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri Feb 6 21:47:14 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri Feb 6 21:47:14 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: 0x56319dae5c10>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri Feb 6 21:47:14 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri Feb 6 21:47:14 2026"
>
> ColMode(tmp2)
<pointer: 0x56319dae5c10>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.2674411 -2.0201317 1.1207801 -0.1653873
[2,] 0.2361541 -0.1345513 -1.2952099 1.3268739
[3,] 1.2362816 0.1694328 0.1073152 -0.1863126
[4,] 0.3495083 0.3046006 -0.8175188 0.1916981
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.2674411 2.0201317 1.1207801 0.1653873
[2,] 0.2361541 0.1345513 1.2952099 1.3268739
[3,] 1.2362816 0.1694328 0.1073152 0.1863126
[4,] 0.3495083 0.3046006 0.8175188 0.1916981
> 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.0133631 1.4213134 1.0586690 0.4066784
[2,] 0.4859569 0.3668123 1.1380729 1.1519001
[3,] 1.1118820 0.4116221 0.3275900 0.4316394
[4,] 0.5911923 0.5519064 0.9041675 0.4378334
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 225.40107 41.23327 36.70747 29.23217
[2,] 30.09572 28.80267 37.67594 37.84588
[3,] 37.35510 29.28565 28.38322 29.50271
[4,] 31.26143 30.82366 34.85919 29.57003
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x56319e93cff0>
> exp(tmp5)
<pointer: 0x56319e93cff0>
> log(tmp5,2)
<pointer: 0x56319e93cff0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 469.1428
> Min(tmp5)
[1] 52.40844
> mean(tmp5)
[1] 73.14933
> Sum(tmp5)
[1] 14629.87
> Var(tmp5)
[1] 868.772
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 92.96596 72.20512 71.67436 67.94108 72.29483 69.26677 70.97917 68.67278
[9] 74.41100 71.08228
> rowSums(tmp5)
[1] 1859.319 1444.102 1433.487 1358.822 1445.897 1385.335 1419.583 1373.456
[9] 1488.220 1421.646
> rowVars(tmp5)
[1] 7917.45589 81.11991 90.92159 50.50190 71.68398 50.93477
[7] 73.22527 83.73527 104.56606 81.08839
> rowSd(tmp5)
[1] 88.980087 9.006659 9.535281 7.106469 8.466639 7.136860 8.557176
[8] 9.150698 10.225755 9.004909
> rowMax(tmp5)
[1] 469.14280 95.18876 92.28138 83.07962 93.72959 80.19430 86.79965
[8] 85.02854 97.10158 89.05219
> rowMin(tmp5)
[1] 56.36732 59.09256 53.93334 57.73775 58.79752 54.21947 52.40844 53.28897
[9] 54.72785 58.88723
>
> colMeans(tmp5)
[1] 109.29673 68.77636 69.83817 68.02037 69.35899 71.23155 75.88670
[8] 71.98740 70.30148 69.65364 72.04493 74.75459 72.51610 73.19087
[15] 69.13967 69.50824 70.38914 72.69700 74.87776 69.51699
> colSums(tmp5)
[1] 1092.9673 687.7636 698.3817 680.2037 693.5899 712.3155 758.8670
[8] 719.8740 703.0148 696.5364 720.4493 747.5459 725.1610 731.9087
[15] 691.3967 695.0824 703.8914 726.9700 748.7776 695.1699
> colVars(tmp5)
[1] 16047.10243 104.30380 121.66158 44.98377 80.64463 91.53409
[7] 58.75172 114.85580 135.36178 57.52560 92.66252 87.11006
[13] 72.62116 73.16414 56.59973 69.01745 71.75034 19.61038
[19] 133.08831 46.29346
> colSd(tmp5)
[1] 126.677158 10.212923 11.030031 6.706994 8.980236 9.567345
[7] 7.664967 10.717080 11.634508 7.584563 9.626137 9.333277
[13] 8.521805 8.553604 7.523279 8.307674 8.470557 4.428360
[19] 11.536391 6.803930
> colMax(tmp5)
[1] 469.14280 86.79965 88.59474 78.77123 86.98941 84.36239 89.05219
[8] 93.72959 84.95982 83.07962 92.28138 95.18876 85.02854 84.91135
[15] 78.00910 79.24967 81.73180 80.32318 97.10158 81.77795
> colMin(tmp5)
[1] 55.69381 57.43086 54.72785 60.84293 58.79752 56.36732 67.47332 59.40155
[9] 52.40844 54.21947 63.16384 59.61157 59.38105 58.45515 58.33086 53.28897
[17] 53.93334 64.97116 61.20557 60.97288
>
>
> ### 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] 92.96596 72.20512 71.67436 67.94108 72.29483 69.26677 70.97917 68.67278
[9] NA 71.08228
> rowSums(tmp5)
[1] 1859.319 1444.102 1433.487 1358.822 1445.897 1385.335 1419.583 1373.456
[9] NA 1421.646
> rowVars(tmp5)
[1] 7917.45589 81.11991 90.92159 50.50190 71.68398 50.93477
[7] 73.22527 83.73527 102.62960 81.08839
> rowSd(tmp5)
[1] 88.980087 9.006659 9.535281 7.106469 8.466639 7.136860 8.557176
[8] 9.150698 10.130627 9.004909
> rowMax(tmp5)
[1] 469.14280 95.18876 92.28138 83.07962 93.72959 80.19430 86.79965
[8] 85.02854 NA 89.05219
> rowMin(tmp5)
[1] 56.36732 59.09256 53.93334 57.73775 58.79752 54.21947 52.40844 53.28897
[9] NA 58.88723
>
> colMeans(tmp5)
[1] 109.29673 68.77636 69.83817 68.02037 69.35899 71.23155 75.88670
[8] 71.98740 70.30148 69.65364 NA 74.75459 72.51610 73.19087
[15] 69.13967 69.50824 70.38914 72.69700 74.87776 69.51699
> colSums(tmp5)
[1] 1092.9673 687.7636 698.3817 680.2037 693.5899 712.3155 758.8670
[8] 719.8740 703.0148 696.5364 NA 747.5459 725.1610 731.9087
[15] 691.3967 695.0824 703.8914 726.9700 748.7776 695.1699
> colVars(tmp5)
[1] 16047.10243 104.30380 121.66158 44.98377 80.64463 91.53409
[7] 58.75172 114.85580 135.36178 57.52560 NA 87.11006
[13] 72.62116 73.16414 56.59973 69.01745 71.75034 19.61038
[19] 133.08831 46.29346
> colSd(tmp5)
[1] 126.677158 10.212923 11.030031 6.706994 8.980236 9.567345
[7] 7.664967 10.717080 11.634508 7.584563 NA 9.333277
[13] 8.521805 8.553604 7.523279 8.307674 8.470557 4.428360
[19] 11.536391 6.803930
> colMax(tmp5)
[1] 469.14280 86.79965 88.59474 78.77123 86.98941 84.36239 89.05219
[8] 93.72959 84.95982 83.07962 NA 95.18876 85.02854 84.91135
[15] 78.00910 79.24967 81.73180 80.32318 97.10158 81.77795
> colMin(tmp5)
[1] 55.69381 57.43086 54.72785 60.84293 58.79752 56.36732 67.47332 59.40155
[9] 52.40844 54.21947 NA 59.61157 59.38105 58.45515 58.33086 53.28897
[17] 53.93334 64.97116 61.20557 60.97288
>
> Max(tmp5,na.rm=TRUE)
[1] 469.1428
> Min(tmp5,na.rm=TRUE)
[1] 52.40844
> mean(tmp5,na.rm=TRUE)
[1] 73.08516
> Sum(tmp5,na.rm=TRUE)
[1] 14543.95
> Var(tmp5,na.rm=TRUE)
[1] 872.3319
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 92.96596 72.20512 71.67436 67.94108 72.29483 69.26677 70.97917 68.67278
[9] 73.80528 71.08228
> rowSums(tmp5,na.rm=TRUE)
[1] 1859.319 1444.102 1433.487 1358.822 1445.897 1385.335 1419.583 1373.456
[9] 1402.300 1421.646
> rowVars(tmp5,na.rm=TRUE)
[1] 7917.45589 81.11991 90.92159 50.50190 71.68398 50.93477
[7] 73.22527 83.73527 102.62960 81.08839
> rowSd(tmp5,na.rm=TRUE)
[1] 88.980087 9.006659 9.535281 7.106469 8.466639 7.136860 8.557176
[8] 9.150698 10.130627 9.004909
> rowMax(tmp5,na.rm=TRUE)
[1] 469.14280 95.18876 92.28138 83.07962 93.72959 80.19430 86.79965
[8] 85.02854 97.10158 89.05219
> rowMin(tmp5,na.rm=TRUE)
[1] 56.36732 59.09256 53.93334 57.73775 58.79752 54.21947 52.40844 53.28897
[9] 54.72785 58.88723
>
> colMeans(tmp5,na.rm=TRUE)
[1] 109.29673 68.77636 69.83817 68.02037 69.35899 71.23155 75.88670
[8] 71.98740 70.30148 69.65364 70.50328 74.75459 72.51610 73.19087
[15] 69.13967 69.50824 70.38914 72.69700 74.87776 69.51699
> colSums(tmp5,na.rm=TRUE)
[1] 1092.9673 687.7636 698.3817 680.2037 693.5899 712.3155 758.8670
[8] 719.8740 703.0148 696.5364 634.5295 747.5459 725.1610 731.9087
[15] 691.3967 695.0824 703.8914 726.9700 748.7776 695.1699
> colVars(tmp5,na.rm=TRUE)
[1] 16047.10243 104.30380 121.66158 44.98377 80.64463 91.53409
[7] 58.75172 114.85580 135.36178 57.52560 77.50775 87.11006
[13] 72.62116 73.16414 56.59973 69.01745 71.75034 19.61038
[19] 133.08831 46.29346
> colSd(tmp5,na.rm=TRUE)
[1] 126.677158 10.212923 11.030031 6.706994 8.980236 9.567345
[7] 7.664967 10.717080 11.634508 7.584563 8.803849 9.333277
[13] 8.521805 8.553604 7.523279 8.307674 8.470557 4.428360
[19] 11.536391 6.803930
> colMax(tmp5,na.rm=TRUE)
[1] 469.14280 86.79965 88.59474 78.77123 86.98941 84.36239 89.05219
[8] 93.72959 84.95982 83.07962 92.28138 95.18876 85.02854 84.91135
[15] 78.00910 79.24967 81.73180 80.32318 97.10158 81.77795
> colMin(tmp5,na.rm=TRUE)
[1] 55.69381 57.43086 54.72785 60.84293 58.79752 56.36732 67.47332 59.40155
[9] 52.40844 54.21947 63.16384 59.61157 59.38105 58.45515 58.33086 53.28897
[17] 53.93334 64.97116 61.20557 60.97288
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 92.96596 72.20512 71.67436 67.94108 72.29483 69.26677 70.97917 68.67278
[9] NaN 71.08228
> rowSums(tmp5,na.rm=TRUE)
[1] 1859.319 1444.102 1433.487 1358.822 1445.897 1385.335 1419.583 1373.456
[9] 0.000 1421.646
> rowVars(tmp5,na.rm=TRUE)
[1] 7917.45589 81.11991 90.92159 50.50190 71.68398 50.93477
[7] 73.22527 83.73527 NA 81.08839
> rowSd(tmp5,na.rm=TRUE)
[1] 88.980087 9.006659 9.535281 7.106469 8.466639 7.136860 8.557176
[8] 9.150698 NA 9.004909
> rowMax(tmp5,na.rm=TRUE)
[1] 469.14280 95.18876 92.28138 83.07962 93.72959 80.19430 86.79965
[8] 85.02854 NA 89.05219
> rowMin(tmp5,na.rm=TRUE)
[1] 56.36732 59.09256 53.93334 57.73775 58.79752 54.21947 52.40844 53.28897
[9] NA 58.88723
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 112.72681 69.00893 71.51709 67.64652 69.31775 69.81417 74.63951
[8] 71.54906 68.67278 69.74948 NaN 74.63990 72.27780 74.82818
[15] 69.88071 68.80183 69.76189 73.17504 72.40845 69.26378
> colSums(tmp5,na.rm=TRUE)
[1] 1014.5413 621.0804 643.6539 608.8187 623.8597 628.3275 671.7556
[8] 643.9416 618.0550 627.7453 0.0000 671.7591 650.5002 673.4536
[15] 628.9264 619.2165 627.8570 658.5754 651.6760 623.3740
> colVars(tmp5,na.rm=TRUE)
[1] 17920.62909 116.73326 105.15794 49.03445 90.70607 80.37493
[7] 48.59658 127.05125 122.43939 64.61296 NA 97.85081
[13] 81.05997 52.15109 57.49677 72.03074 76.29289 19.49071
[19] 81.12736 51.35886
> colSd(tmp5,na.rm=TRUE)
[1] 133.867954 10.804317 10.254655 7.002460 9.523974 8.965207
[7] 6.971124 11.271701 11.065233 8.038219 NA 9.891957
[13] 9.003331 7.221571 7.582663 8.487092 8.734580 4.414829
[19] 9.007073 7.166510
> colMax(tmp5,na.rm=TRUE)
[1] 469.14280 86.79965 88.59474 78.77123 86.98941 84.36239 89.05219
[8] 93.72959 82.89721 83.07962 -Inf 95.18876 85.02854 84.91135
[15] 78.00910 79.24967 81.73180 80.32318 83.25374 81.77795
> colMin(tmp5,na.rm=TRUE)
[1] 55.69381 57.43086 58.08185 60.84293 58.79752 56.36732 67.47332 59.40155
[9] 52.40844 54.21947 Inf 59.61157 59.38105 64.39275 58.33086 53.28897
[17] 53.93334 64.97116 61.20557 60.97288
>
>
>
>
> 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] 219.8528 174.9335 213.5619 259.6254 187.1300 326.7886 141.8389 326.7513
[9] 271.0319 311.2193
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 219.8528 174.9335 213.5619 259.6254 187.1300 326.7886 141.8389 326.7513
[9] 271.0319 311.2193
>
>
>
> 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] 8.526513e-14 0.000000e+00 -8.526513e-14 8.526513e-14 -5.684342e-14
[6] 1.989520e-13 1.136868e-13 0.000000e+00 -1.705303e-13 2.842171e-14
[11] 1.705303e-13 4.263256e-14 5.684342e-14 5.684342e-14 5.684342e-14
[16] -2.842171e-14 -2.842171e-14 0.000000e+00 5.684342e-14 0.000000e+00
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
6 15
9 13
1 12
8 1
3 13
7 12
2 6
3 2
2 20
2 18
5 20
9 4
9 3
10 4
6 18
5 1
10 11
6 10
1 11
2 13
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 2.304563
> Min(tmp)
[1] -2.172589
> mean(tmp)
[1] 0.06702426
> Sum(tmp)
[1] 6.702426
> Var(tmp)
[1] 0.7842928
>
> rowMeans(tmp)
[1] 0.06702426
> rowSums(tmp)
[1] 6.702426
> rowVars(tmp)
[1] 0.7842928
> rowSd(tmp)
[1] 0.8856031
> rowMax(tmp)
[1] 2.304563
> rowMin(tmp)
[1] -2.172589
>
> colMeans(tmp)
[1] 0.277509948 -1.273504923 0.463775660 -1.380399472 -0.875700122
[6] 1.141896150 0.460233748 -0.516264628 -0.360646047 0.731895153
[11] 1.981075376 0.492292938 0.575882729 2.304562646 1.096079584
[16] 0.963649524 -0.242242400 -1.122525685 -0.309862937 1.726636278
[21] 0.101968380 -0.215320631 -1.352586286 0.153624277 -0.802669036
[26] -0.014764115 0.631985569 -1.828974171 -0.682484333 -1.311762272
[31] 0.840019939 1.094290258 1.575319698 -0.393471014 0.889180376
[36] 0.715311577 1.400191351 0.263439924 0.506173947 -0.209960299
[41] -0.813843569 0.806981665 0.507101586 -0.132557583 1.085733180
[46] -0.843483599 -0.111934526 -0.080905739 0.246731668 -0.225656710
[51] -0.391916128 -0.363208950 -1.476831933 0.984150124 -0.140594009
[56] 0.632574259 0.913107010 -0.138856115 0.843314561 -0.374247379
[61] 0.425524120 1.352158065 -0.417200568 0.813693381 1.583998424
[66] 0.244211553 -0.857485235 -0.399963825 -0.211508829 -2.165940466
[71] 0.614462658 -0.124386682 0.014276420 1.077636940 0.001223263
[76] -0.049442774 -0.964467292 -0.821349989 0.480022636 0.329185034
[81] 1.303526952 0.200703805 -0.742898309 0.017642656 0.950317096
[86] -0.424828714 0.299815239 -1.481872131 0.470423240 0.553486350
[91] 0.009641107 -0.113141542 -2.172588911 0.133753993 -0.711352958
[96] 0.389789426 0.469622664 -0.990565549 0.382584776 -1.185794285
> colSums(tmp)
[1] 0.277509948 -1.273504923 0.463775660 -1.380399472 -0.875700122
[6] 1.141896150 0.460233748 -0.516264628 -0.360646047 0.731895153
[11] 1.981075376 0.492292938 0.575882729 2.304562646 1.096079584
[16] 0.963649524 -0.242242400 -1.122525685 -0.309862937 1.726636278
[21] 0.101968380 -0.215320631 -1.352586286 0.153624277 -0.802669036
[26] -0.014764115 0.631985569 -1.828974171 -0.682484333 -1.311762272
[31] 0.840019939 1.094290258 1.575319698 -0.393471014 0.889180376
[36] 0.715311577 1.400191351 0.263439924 0.506173947 -0.209960299
[41] -0.813843569 0.806981665 0.507101586 -0.132557583 1.085733180
[46] -0.843483599 -0.111934526 -0.080905739 0.246731668 -0.225656710
[51] -0.391916128 -0.363208950 -1.476831933 0.984150124 -0.140594009
[56] 0.632574259 0.913107010 -0.138856115 0.843314561 -0.374247379
[61] 0.425524120 1.352158065 -0.417200568 0.813693381 1.583998424
[66] 0.244211553 -0.857485235 -0.399963825 -0.211508829 -2.165940466
[71] 0.614462658 -0.124386682 0.014276420 1.077636940 0.001223263
[76] -0.049442774 -0.964467292 -0.821349989 0.480022636 0.329185034
[81] 1.303526952 0.200703805 -0.742898309 0.017642656 0.950317096
[86] -0.424828714 0.299815239 -1.481872131 0.470423240 0.553486350
[91] 0.009641107 -0.113141542 -2.172588911 0.133753993 -0.711352958
[96] 0.389789426 0.469622664 -0.990565549 0.382584776 -1.185794285
> 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.277509948 -1.273504923 0.463775660 -1.380399472 -0.875700122
[6] 1.141896150 0.460233748 -0.516264628 -0.360646047 0.731895153
[11] 1.981075376 0.492292938 0.575882729 2.304562646 1.096079584
[16] 0.963649524 -0.242242400 -1.122525685 -0.309862937 1.726636278
[21] 0.101968380 -0.215320631 -1.352586286 0.153624277 -0.802669036
[26] -0.014764115 0.631985569 -1.828974171 -0.682484333 -1.311762272
[31] 0.840019939 1.094290258 1.575319698 -0.393471014 0.889180376
[36] 0.715311577 1.400191351 0.263439924 0.506173947 -0.209960299
[41] -0.813843569 0.806981665 0.507101586 -0.132557583 1.085733180
[46] -0.843483599 -0.111934526 -0.080905739 0.246731668 -0.225656710
[51] -0.391916128 -0.363208950 -1.476831933 0.984150124 -0.140594009
[56] 0.632574259 0.913107010 -0.138856115 0.843314561 -0.374247379
[61] 0.425524120 1.352158065 -0.417200568 0.813693381 1.583998424
[66] 0.244211553 -0.857485235 -0.399963825 -0.211508829 -2.165940466
[71] 0.614462658 -0.124386682 0.014276420 1.077636940 0.001223263
[76] -0.049442774 -0.964467292 -0.821349989 0.480022636 0.329185034
[81] 1.303526952 0.200703805 -0.742898309 0.017642656 0.950317096
[86] -0.424828714 0.299815239 -1.481872131 0.470423240 0.553486350
[91] 0.009641107 -0.113141542 -2.172588911 0.133753993 -0.711352958
[96] 0.389789426 0.469622664 -0.990565549 0.382584776 -1.185794285
> colMin(tmp)
[1] 0.277509948 -1.273504923 0.463775660 -1.380399472 -0.875700122
[6] 1.141896150 0.460233748 -0.516264628 -0.360646047 0.731895153
[11] 1.981075376 0.492292938 0.575882729 2.304562646 1.096079584
[16] 0.963649524 -0.242242400 -1.122525685 -0.309862937 1.726636278
[21] 0.101968380 -0.215320631 -1.352586286 0.153624277 -0.802669036
[26] -0.014764115 0.631985569 -1.828974171 -0.682484333 -1.311762272
[31] 0.840019939 1.094290258 1.575319698 -0.393471014 0.889180376
[36] 0.715311577 1.400191351 0.263439924 0.506173947 -0.209960299
[41] -0.813843569 0.806981665 0.507101586 -0.132557583 1.085733180
[46] -0.843483599 -0.111934526 -0.080905739 0.246731668 -0.225656710
[51] -0.391916128 -0.363208950 -1.476831933 0.984150124 -0.140594009
[56] 0.632574259 0.913107010 -0.138856115 0.843314561 -0.374247379
[61] 0.425524120 1.352158065 -0.417200568 0.813693381 1.583998424
[66] 0.244211553 -0.857485235 -0.399963825 -0.211508829 -2.165940466
[71] 0.614462658 -0.124386682 0.014276420 1.077636940 0.001223263
[76] -0.049442774 -0.964467292 -0.821349989 0.480022636 0.329185034
[81] 1.303526952 0.200703805 -0.742898309 0.017642656 0.950317096
[86] -0.424828714 0.299815239 -1.481872131 0.470423240 0.553486350
[91] 0.009641107 -0.113141542 -2.172588911 0.133753993 -0.711352958
[96] 0.389789426 0.469622664 -0.990565549 0.382584776 -1.185794285
> colMedians(tmp)
[1] 0.277509948 -1.273504923 0.463775660 -1.380399472 -0.875700122
[6] 1.141896150 0.460233748 -0.516264628 -0.360646047 0.731895153
[11] 1.981075376 0.492292938 0.575882729 2.304562646 1.096079584
[16] 0.963649524 -0.242242400 -1.122525685 -0.309862937 1.726636278
[21] 0.101968380 -0.215320631 -1.352586286 0.153624277 -0.802669036
[26] -0.014764115 0.631985569 -1.828974171 -0.682484333 -1.311762272
[31] 0.840019939 1.094290258 1.575319698 -0.393471014 0.889180376
[36] 0.715311577 1.400191351 0.263439924 0.506173947 -0.209960299
[41] -0.813843569 0.806981665 0.507101586 -0.132557583 1.085733180
[46] -0.843483599 -0.111934526 -0.080905739 0.246731668 -0.225656710
[51] -0.391916128 -0.363208950 -1.476831933 0.984150124 -0.140594009
[56] 0.632574259 0.913107010 -0.138856115 0.843314561 -0.374247379
[61] 0.425524120 1.352158065 -0.417200568 0.813693381 1.583998424
[66] 0.244211553 -0.857485235 -0.399963825 -0.211508829 -2.165940466
[71] 0.614462658 -0.124386682 0.014276420 1.077636940 0.001223263
[76] -0.049442774 -0.964467292 -0.821349989 0.480022636 0.329185034
[81] 1.303526952 0.200703805 -0.742898309 0.017642656 0.950317096
[86] -0.424828714 0.299815239 -1.481872131 0.470423240 0.553486350
[91] 0.009641107 -0.113141542 -2.172588911 0.133753993 -0.711352958
[96] 0.389789426 0.469622664 -0.990565549 0.382584776 -1.185794285
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.2775099 -1.273505 0.4637757 -1.380399 -0.8757001 1.141896 0.4602337
[2,] 0.2775099 -1.273505 0.4637757 -1.380399 -0.8757001 1.141896 0.4602337
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.5162646 -0.360646 0.7318952 1.981075 0.4922929 0.5758827 2.304563
[2,] -0.5162646 -0.360646 0.7318952 1.981075 0.4922929 0.5758827 2.304563
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 1.09608 0.9636495 -0.2422424 -1.122526 -0.3098629 1.726636 0.1019684
[2,] 1.09608 0.9636495 -0.2422424 -1.122526 -0.3098629 1.726636 0.1019684
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.2153206 -1.352586 0.1536243 -0.802669 -0.01476412 0.6319856 -1.828974
[2,] -0.2153206 -1.352586 0.1536243 -0.802669 -0.01476412 0.6319856 -1.828974
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.6824843 -1.311762 0.8400199 1.09429 1.57532 -0.393471 0.8891804
[2,] -0.6824843 -1.311762 0.8400199 1.09429 1.57532 -0.393471 0.8891804
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.7153116 1.400191 0.2634399 0.5061739 -0.2099603 -0.8138436 0.8069817
[2,] 0.7153116 1.400191 0.2634399 0.5061739 -0.2099603 -0.8138436 0.8069817
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.5071016 -0.1325576 1.085733 -0.8434836 -0.1119345 -0.08090574 0.2467317
[2,] 0.5071016 -0.1325576 1.085733 -0.8434836 -0.1119345 -0.08090574 0.2467317
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.2256567 -0.3919161 -0.3632089 -1.476832 0.9841501 -0.140594 0.6325743
[2,] -0.2256567 -0.3919161 -0.3632089 -1.476832 0.9841501 -0.140594 0.6325743
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.913107 -0.1388561 0.8433146 -0.3742474 0.4255241 1.352158 -0.4172006
[2,] 0.913107 -0.1388561 0.8433146 -0.3742474 0.4255241 1.352158 -0.4172006
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.8136934 1.583998 0.2442116 -0.8574852 -0.3999638 -0.2115088 -2.16594
[2,] 0.8136934 1.583998 0.2442116 -0.8574852 -0.3999638 -0.2115088 -2.16594
[,71] [,72] [,73] [,74] [,75] [,76]
[1,] 0.6144627 -0.1243867 0.01427642 1.077637 0.001223263 -0.04944277
[2,] 0.6144627 -0.1243867 0.01427642 1.077637 0.001223263 -0.04944277
[,77] [,78] [,79] [,80] [,81] [,82] [,83]
[1,] -0.9644673 -0.82135 0.4800226 0.329185 1.303527 0.2007038 -0.7428983
[2,] -0.9644673 -0.82135 0.4800226 0.329185 1.303527 0.2007038 -0.7428983
[,84] [,85] [,86] [,87] [,88] [,89] [,90]
[1,] 0.01764266 0.9503171 -0.4248287 0.2998152 -1.481872 0.4704232 0.5534864
[2,] 0.01764266 0.9503171 -0.4248287 0.2998152 -1.481872 0.4704232 0.5534864
[,91] [,92] [,93] [,94] [,95] [,96] [,97]
[1,] 0.009641107 -0.1131415 -2.172589 0.133754 -0.711353 0.3897894 0.4696227
[2,] 0.009641107 -0.1131415 -2.172589 0.133754 -0.711353 0.3897894 0.4696227
[,98] [,99] [,100]
[1,] -0.9905655 0.3825848 -1.185794
[2,] -0.9905655 0.3825848 -1.185794
>
>
> Max(tmp2)
[1] 2.366417
> Min(tmp2)
[1] -1.921036
> mean(tmp2)
[1] 0.03446079
> Sum(tmp2)
[1] 3.446079
> Var(tmp2)
[1] 0.7743917
>
> rowMeans(tmp2)
[1] 0.361144647 -0.044943814 -0.147284955 1.306709753 -0.705167970
[6] 0.263392578 1.336188580 0.176821554 -0.635963584 0.551828057
[11] 0.727149177 1.178476238 0.789892141 -1.921035611 -0.189793965
[16] 0.401644006 -0.029969739 0.724667590 -1.020340616 1.354216004
[21] -0.284926196 0.593449421 -0.527840931 -0.429262624 1.110679494
[26] -0.501223690 0.262651953 -0.186179361 -0.810559663 -0.476873980
[31] -0.384238246 0.513126909 -1.871486025 -0.272131157 0.173060131
[36] 0.146883994 0.597290035 -0.452068904 1.070220574 -0.140738110
[41] -0.274500150 -0.387235065 -0.650784940 1.046065282 -1.131290370
[46] 0.513608168 1.095444883 -0.525932156 -0.387302078 -1.256437706
[51] 0.788296269 -0.418828297 1.174425224 -0.559556628 -0.709528951
[56] -0.182364448 0.253285231 -0.478165680 0.184912280 1.721897860
[61] 1.474714478 -0.356696718 -1.491743177 -0.480352528 -0.231931252
[66] -0.764951572 1.054967780 0.621953654 -0.845312169 -0.582176219
[71] 1.229807837 -1.725815549 -0.727847431 -0.203404108 -0.436963260
[76] 2.366416880 -0.599960713 0.577755475 2.239674226 -0.238031110
[81] -1.138982226 -0.868526706 -0.067380481 -1.122592137 -0.649705235
[86] 2.142695772 1.168606755 -0.660404175 0.717097373 -1.470115334
[91] 0.652593915 -0.195291418 -0.411797642 -0.020027364 0.054560061
[96] 0.332755188 1.030024941 -0.254320055 0.005919801 0.897391136
> rowSums(tmp2)
[1] 0.361144647 -0.044943814 -0.147284955 1.306709753 -0.705167970
[6] 0.263392578 1.336188580 0.176821554 -0.635963584 0.551828057
[11] 0.727149177 1.178476238 0.789892141 -1.921035611 -0.189793965
[16] 0.401644006 -0.029969739 0.724667590 -1.020340616 1.354216004
[21] -0.284926196 0.593449421 -0.527840931 -0.429262624 1.110679494
[26] -0.501223690 0.262651953 -0.186179361 -0.810559663 -0.476873980
[31] -0.384238246 0.513126909 -1.871486025 -0.272131157 0.173060131
[36] 0.146883994 0.597290035 -0.452068904 1.070220574 -0.140738110
[41] -0.274500150 -0.387235065 -0.650784940 1.046065282 -1.131290370
[46] 0.513608168 1.095444883 -0.525932156 -0.387302078 -1.256437706
[51] 0.788296269 -0.418828297 1.174425224 -0.559556628 -0.709528951
[56] -0.182364448 0.253285231 -0.478165680 0.184912280 1.721897860
[61] 1.474714478 -0.356696718 -1.491743177 -0.480352528 -0.231931252
[66] -0.764951572 1.054967780 0.621953654 -0.845312169 -0.582176219
[71] 1.229807837 -1.725815549 -0.727847431 -0.203404108 -0.436963260
[76] 2.366416880 -0.599960713 0.577755475 2.239674226 -0.238031110
[81] -1.138982226 -0.868526706 -0.067380481 -1.122592137 -0.649705235
[86] 2.142695772 1.168606755 -0.660404175 0.717097373 -1.470115334
[91] 0.652593915 -0.195291418 -0.411797642 -0.020027364 0.054560061
[96] 0.332755188 1.030024941 -0.254320055 0.005919801 0.897391136
> 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.361144647 -0.044943814 -0.147284955 1.306709753 -0.705167970
[6] 0.263392578 1.336188580 0.176821554 -0.635963584 0.551828057
[11] 0.727149177 1.178476238 0.789892141 -1.921035611 -0.189793965
[16] 0.401644006 -0.029969739 0.724667590 -1.020340616 1.354216004
[21] -0.284926196 0.593449421 -0.527840931 -0.429262624 1.110679494
[26] -0.501223690 0.262651953 -0.186179361 -0.810559663 -0.476873980
[31] -0.384238246 0.513126909 -1.871486025 -0.272131157 0.173060131
[36] 0.146883994 0.597290035 -0.452068904 1.070220574 -0.140738110
[41] -0.274500150 -0.387235065 -0.650784940 1.046065282 -1.131290370
[46] 0.513608168 1.095444883 -0.525932156 -0.387302078 -1.256437706
[51] 0.788296269 -0.418828297 1.174425224 -0.559556628 -0.709528951
[56] -0.182364448 0.253285231 -0.478165680 0.184912280 1.721897860
[61] 1.474714478 -0.356696718 -1.491743177 -0.480352528 -0.231931252
[66] -0.764951572 1.054967780 0.621953654 -0.845312169 -0.582176219
[71] 1.229807837 -1.725815549 -0.727847431 -0.203404108 -0.436963260
[76] 2.366416880 -0.599960713 0.577755475 2.239674226 -0.238031110
[81] -1.138982226 -0.868526706 -0.067380481 -1.122592137 -0.649705235
[86] 2.142695772 1.168606755 -0.660404175 0.717097373 -1.470115334
[91] 0.652593915 -0.195291418 -0.411797642 -0.020027364 0.054560061
[96] 0.332755188 1.030024941 -0.254320055 0.005919801 0.897391136
> rowMin(tmp2)
[1] 0.361144647 -0.044943814 -0.147284955 1.306709753 -0.705167970
[6] 0.263392578 1.336188580 0.176821554 -0.635963584 0.551828057
[11] 0.727149177 1.178476238 0.789892141 -1.921035611 -0.189793965
[16] 0.401644006 -0.029969739 0.724667590 -1.020340616 1.354216004
[21] -0.284926196 0.593449421 -0.527840931 -0.429262624 1.110679494
[26] -0.501223690 0.262651953 -0.186179361 -0.810559663 -0.476873980
[31] -0.384238246 0.513126909 -1.871486025 -0.272131157 0.173060131
[36] 0.146883994 0.597290035 -0.452068904 1.070220574 -0.140738110
[41] -0.274500150 -0.387235065 -0.650784940 1.046065282 -1.131290370
[46] 0.513608168 1.095444883 -0.525932156 -0.387302078 -1.256437706
[51] 0.788296269 -0.418828297 1.174425224 -0.559556628 -0.709528951
[56] -0.182364448 0.253285231 -0.478165680 0.184912280 1.721897860
[61] 1.474714478 -0.356696718 -1.491743177 -0.480352528 -0.231931252
[66] -0.764951572 1.054967780 0.621953654 -0.845312169 -0.582176219
[71] 1.229807837 -1.725815549 -0.727847431 -0.203404108 -0.436963260
[76] 2.366416880 -0.599960713 0.577755475 2.239674226 -0.238031110
[81] -1.138982226 -0.868526706 -0.067380481 -1.122592137 -0.649705235
[86] 2.142695772 1.168606755 -0.660404175 0.717097373 -1.470115334
[91] 0.652593915 -0.195291418 -0.411797642 -0.020027364 0.054560061
[96] 0.332755188 1.030024941 -0.254320055 0.005919801 0.897391136
>
> colMeans(tmp2)
[1] 0.03446079
> colSums(tmp2)
[1] 3.446079
> colVars(tmp2)
[1] 0.7743917
> colSd(tmp2)
[1] 0.8799953
> colMax(tmp2)
[1] 2.366417
> colMin(tmp2)
[1] -1.921036
> colMedians(tmp2)
[1] -0.1648247
> colRanges(tmp2)
[,1]
[1,] -1.921036
[2,] 2.366417
>
> 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] -2.6542590 -1.0211476 -0.3059891 0.2481150 -2.2789044 4.8959884
[7] 2.1567923 -6.7600135 -1.4502992 -0.5952058
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.72808767
[2,] -1.14800126
[3,] -0.03581517
[4,] 0.52385244
[5,] 1.05682454
>
> rowApply(tmp,sum)
[1] -3.6396924 -1.2281720 2.0964975 -0.7725646 1.6629778 -1.4776292
[7] -3.6054608 -2.2976202 2.1029697 -0.6062288
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 8 1 7 7 2 1 9 5 6 2
[2,] 1 6 9 1 3 6 6 9 8 5
[3,] 9 3 3 9 8 3 2 6 4 7
[4,] 3 5 1 5 7 10 7 10 9 1
[5,] 6 4 5 3 9 2 8 7 2 6
[6,] 10 8 10 8 6 4 10 2 10 8
[7,] 7 7 2 10 1 7 5 8 5 10
[8,] 5 10 4 4 4 8 1 3 1 3
[9,] 2 2 8 2 10 9 3 4 7 4
[10,] 4 9 6 6 5 5 4 1 3 9
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 1.45648526 1.73424417 -2.20371394 1.14413078 1.50564797 0.22833747
[7] 0.77270134 3.97346161 -3.08075012 2.30367384 2.25352247 0.70840219
[13] -0.53315145 -1.11211658 0.45949498 0.93056297 5.79189110 -0.85682370
[19] -0.04732654 -2.08413204
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.04890867
[2,] -0.39767567
[3,] 0.02487967
[4,] 0.47989216
[5,] 2.39829778
>
> rowApply(tmp,sum)
[1] 6.973259 3.972922 -4.157214 -1.604673 8.160248
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 20 10 17 9 3
[2,] 10 6 18 10 16
[3,] 15 4 8 8 1
[4,] 9 19 3 17 6
[5,] 17 15 5 7 13
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 2.39829778 0.3265672 0.8590908 0.2767211 1.3660965 -1.3676119
[2,] 0.02487967 -0.5988072 -0.9346145 1.8106263 1.0947383 0.2962638
[3,] 0.47989216 0.7486077 -0.2896172 -1.4084699 -1.1038701 -0.2562275
[4,] -0.39767567 -0.1788724 -0.4349024 0.8590563 -0.4976744 1.2068738
[5,] -1.04890867 1.4367488 -1.4036707 -0.3938031 0.6463576 0.3490392
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.3656611 1.09011102 -0.3650464 -0.1474504 0.8012592 -0.21602289
[2,] 1.3293814 -0.04954965 -1.7653506 1.1226414 0.4726672 0.27429554
[3,] -1.5393379 0.18960001 0.8109239 1.6395281 -0.2710968 0.34746085
[4,] 0.5269574 0.82448896 -0.9620723 -0.8906931 -0.8825677 0.01894686
[5,] 0.8213615 1.91881127 -0.7992047 0.5796479 2.1332606 0.28372182
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.37432114 1.5477352 -0.75671943 1.6447156 0.3379600 -0.8255771
[2,] -0.68819465 -0.1319878 -0.28056664 1.6711959 2.5331268 0.4302201
[3,] 0.06811958 -1.1327795 0.15215216 -1.5550940 -0.0856038 -0.4455560
[4,] -1.74567155 -1.5913128 1.29086354 0.3575397 1.1584761 0.5341019
[5,] 1.45827404 0.1962282 0.05376535 -1.1877942 1.8479320 -0.5500126
[,19] [,20]
[1,] 0.6986443 -0.7041716
[2,] -1.3620748 -1.2759689
[3,] -0.9546104 0.4487647
[4,] 0.2869402 -1.0874757
[5,] 1.2837742 0.5347195
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 653 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 0.288544 0.8806084 -0.6486825 -0.05497758 0.1138274 0.7493727 1.613709
col8 col9 col10 col11 col12 col13 col14
row1 -0.05683388 0.8243875 1.224737 1.220652 -0.06234471 -0.702963 -1.184665
col15 col16 col17 col18 col19 col20
row1 0.7281059 -1.111488 1.837093 0.34356 0.006061209 -0.9973569
> tmp[,"col10"]
col10
row1 1.2247370
row2 0.1101949
row3 0.5114613
row4 -0.1803548
row5 0.7372365
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 0.288544 0.8806084 -0.6486825 -0.05497758 0.1138274 0.7493727 1.6137089
row5 1.097208 -0.9847174 0.0941206 0.72777033 0.6943951 1.5348100 0.5410248
col8 col9 col10 col11 col12 col13
row1 -0.05683388 0.8243875 1.2247370 1.2206518 -0.06234471 -0.702963
row5 -0.70084407 0.5857553 0.7372365 -0.6708168 -0.41759530 0.226441
col14 col15 col16 col17 col18 col19
row1 -1.1846653 0.7281059 -1.1114878 1.837093 0.3435600 0.006061209
row5 0.6139361 -0.9561946 0.6149774 1.070296 -0.3071099 -0.420654194
col20
row1 -0.9973569
row5 -0.9308498
> tmp[,c("col6","col20")]
col6 col20
row1 0.7493727 -0.9973569
row2 -0.2067862 -0.2403308
row3 2.1782126 -0.1639437
row4 2.2806999 0.2452493
row5 1.5348100 -0.9308498
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.7493727 -0.9973569
row5 1.5348100 -0.9308498
>
>
>
>
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105)
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.82494 50.51435 50.40758 51.39183 50.59588 104.9012 48.52211 49.64359
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.56737 52.94712 48.23979 51.10924 48.31986 49.60051 51.05094 49.07681
col17 col18 col19 col20
row1 50.88772 49.913 50.72213 103.8628
> tmp[,"col10"]
col10
row1 52.94712
row2 31.12326
row3 30.32166
row4 29.61767
row5 50.70305
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.82494 50.51435 50.40758 51.39183 50.59588 104.9012 48.52211 49.64359
row5 51.26608 48.74864 50.02375 48.72163 49.76972 107.0156 48.59092 50.36650
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.56737 52.94712 48.23979 51.10924 48.31986 49.60051 51.05094 49.07681
row5 49.81661 50.70305 49.36506 49.41488 51.57060 48.78918 49.24724 50.57799
col17 col18 col19 col20
row1 50.88772 49.91300 50.72213 103.8628
row5 51.15576 52.50865 49.24355 107.2537
> tmp[,c("col6","col20")]
col6 col20
row1 104.90122 103.86284
row2 73.83175 74.28797
row3 75.24597 75.26436
row4 75.47793 72.67434
row5 107.01560 107.25373
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.9012 103.8628
row5 107.0156 107.2537
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.9012 103.8628
row5 107.0156 107.2537
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -2.28118979
[2,] -0.28289093
[3,] 0.22456977
[4,] -0.01475561
[5,] -0.01006036
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.28384024 0.41010854
[2,] -0.04147827 1.11392815
[3,] 0.67531674 0.67137121
[4,] 1.17910216 -0.46851966
[5,] -1.55604514 0.09558389
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.76923461 -0.8059447
[2,] -1.17369558 -0.1770124
[3,] 0.65307048 1.8548570
[4,] -0.07035001 1.2266671
[5,] 0.12043193 0.5489471
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.7692346
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.7692346
[2,] -1.1736956
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row3 -0.2872639 0.46123724 0.1415220 -1.144984 -0.3473999 0.5086992 -1.0125869
row1 0.2680187 -0.01071945 0.2042803 -1.882176 1.3858047 0.6256796 0.6811562
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 -0.914610 1.221137 0.7181841 -0.7916093 0.6180256 -0.9783019 1.7572427
row1 1.738643 1.557227 -1.3243001 -0.3672759 0.3237074 -0.2269556 0.4391079
[,15] [,16] [,17] [,18] [,19] [,20]
row3 -1.1193949 0.4734714 -1.2115881 0.9821194 0.1773118 2.3984569
row1 -0.6761497 -1.5660979 -0.3650001 0.8678884 1.6562933 0.9497439
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -1.632757 -1.327844 1.312737 1.215388 1.488126 1.128037 -0.1266257
[,8] [,9] [,10]
row2 -2.148173 1.173047 -0.07774509
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.8549513 0.1843258 0.1594422 1.460532 2.480385 0.2332209 -0.06036653
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 1.176595 1.85673 0.4136958 -0.1002366 -0.3858318 -0.5042934 0.3900698
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.8611021 -0.2549557 -1.592027 -0.2144404 -1.050599 0.9662919
>
>
> 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: 0x56319f2ac810>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM19242c1176283"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM19242c1e4d20eb"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM19242c1fc9e327"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM19242c6aba77bf"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM19242c7cd943ee"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM19242c3c84f0f0"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM19242c30bdee88"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM19242c39cd6060"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM19242c13113869"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM19242c7708d894"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM19242c6a096129"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM19242c531a8ad1"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM19242c5a3ba48c"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM19242cd2bfe01"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM19242c1bad2e6c"
>
>
> ### 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: 0x56319f05e370>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x56319f05e370>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x56319f05e370>
> rowMedians(tmp)
[1] -0.2391174192 -0.3100443634 0.5045823666 -0.5397491724 -0.0932649798
[6] -0.2299235015 0.1308693206 -0.3654946577 -0.3363846724 0.5047770716
[11] -0.4222460360 -0.4927375042 -0.5026067893 -0.1404803223 -0.0419073400
[16] -0.0687767511 0.5543020547 -0.1115577993 -0.2215879484 -0.0181787862
[21] 0.4691655653 0.6831485235 0.2838444833 -0.6500514002 0.1833916068
[26] 0.3099413869 -0.1079552888 0.0127984252 0.1932421686 -0.5678855787
[31] 0.2580402803 0.3038362257 0.5992116681 0.1995745900 0.0786729628
[36] -0.1095246683 0.1251976220 -0.6274903040 -0.4515622981 0.9011710448
[41] 0.0945305207 0.1253320433 -0.0190601973 -0.2261729334 -0.0720021550
[46] 0.4834423262 -0.1136598853 -0.2258938656 0.0808323193 0.2747147005
[51] -0.2094893215 0.5029473357 -0.5690112353 -0.4272372436 -0.2641626470
[56] -0.2690817792 -0.0067798618 -0.5521761985 -0.1414127365 -0.1876056266
[61] -0.5071202155 -0.1947818643 0.2101072391 -0.2949483191 -0.4599097072
[66] 0.2570691800 0.0658099212 -0.0005460543 0.4563432249 0.3037257828
[71] -0.0702522711 0.0790744195 0.6160899911 -0.1866532356 -0.3282619887
[76] 0.3377528736 -0.2817188542 0.0777294575 -0.0645238392 -0.1156974749
[81] -0.0887578232 -0.0369806583 -0.2636325592 0.2326670909 -0.3114593234
[86] -0.3793331288 0.0801301750 -0.2551538281 1.1065632491 0.1583363312
[91] -0.0181075412 0.2080365861 0.3018200722 0.2406123239 -0.4301198852
[96] -0.5625075405 -0.4111308356 -0.6007050402 0.5490754966 -0.1906108779
[101] -0.3793067296 0.1732379517 0.4198876101 0.5664517302 -0.0144531610
[106] -0.2571519715 0.2793807417 -0.4719722911 -0.5612775624 -0.0066439443
[111] 0.5013618687 0.0546688941 0.2668222924 0.3171120206 0.0757162432
[116] 0.0872093701 -0.2799154000 0.2191137596 -0.1741500916 -0.5720998876
[121] 0.7197664522 0.3794314201 -0.4130084888 -0.4504097020 0.3931578481
[126] 0.2224138237 0.1403784604 -0.3733431873 0.3679580091 0.2409530212
[131] 0.2105978572 -0.7458688226 0.0812585790 -0.2256804614 0.3215967411
[136] -0.0312492265 -0.0122481529 0.1997955148 -0.0275943657 0.0495758665
[141] 0.0280100841 0.4651903470 -0.4321422292 0.1015419785 0.4459785046
[146] -0.4421706227 0.0318906699 0.0704014176 0.3022873678 -0.5327465498
[151] 0.6957696793 -0.0376772608 -0.0055501393 0.3811434507 -0.2162825747
[156] -0.0683765267 -0.0212762759 -0.1071628348 0.4011248157 -0.4958777694
[161] 0.2656594743 0.0787777141 -0.1084430673 -0.1574044406 0.5261377049
[166] -0.1776340897 0.2539375479 -0.1244126117 -0.4446301553 -0.2408954198
[171] 0.1263954651 -0.2294212276 -0.1587402191 -0.2001581711 -0.4424020803
[176] 0.0093331363 0.0990431523 0.4088646989 0.6266746553 0.1915524386
[181] -0.2855518889 0.6112998615 0.4249221094 0.2489787503 -0.1620418056
[186] 0.0222624693 -0.1991540522 -0.1393782026 0.2070287496 0.2199410666
[191] -0.1392599544 -0.4365050002 -0.0268259279 -0.3325936473 0.2311619609
[196] 0.2539166941 0.2002496466 -0.0377902099 0.3967248225 -0.1475407919
[201] 0.0755526030 0.0120578991 0.4944310489 0.3329177036 0.3562245314
[206] 0.2656159846 0.2834585954 0.0993228050 0.3022806284 0.2220881853
[211] 0.0176875515 -0.1617923185 0.4189541560 0.4043649114 0.0108375951
[216] -0.1601408867 0.1121778382 0.4169823127 -0.1065192192 0.0134635405
[221] -0.3025670913 0.0970625623 -0.1946490158 0.0476901337 0.3705559709
[226] 0.5307558659 -0.2745079540 0.1468534711 -0.4997746443 0.1576504158
>
> proc.time()
user system elapsed
1.326 1.455 2.768
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
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: 0x5631353f4c10>
> .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: 0x5631353f4c10>
> .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: 0x5631353f4c10>
> .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: 0x5631353f4c10>
> 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: 0x5631360b72d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5631360b72d0>
> .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: 0x5631360b72d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5631360b72d0>
> .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: 0x5631360b72d0>
> 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: 0x56313678cd70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56313678cd70>
> .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: 0x56313678cd70>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x56313678cd70>
> .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: 0x56313678cd70>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x56313678cd70>
> .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: 0x56313678cd70>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x56313678cd70>
> .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: 0x56313678cd70>
> 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: 0x563136300370>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x563136300370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x563136300370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x563136300370>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1924eb3234d358" "BufferedMatrixFile1924eb36e5da96"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1924eb3234d358" "BufferedMatrixFile1924eb36e5da96"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x56313624bff0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56313624bff0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x56313624bff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x56313624bff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x56313624bff0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x56313624bff0>
> .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: 0x56313642e3d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x56313642e3d0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x56313642e3d0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x56313642e3d0>
> 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: 0x563137bdffb0>
> .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: 0x563137bdffb0>
> rm(P)
>
> proc.time()
user system elapsed
0.245 0.052 0.286
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100 0
> buffer.dim(Temp)
[1] 1 1
>
>
> proc.time()
user system elapsed
0.245 0.040 0.273