| Back to Build/check report for BioC 3.22: simplified long |
|
This page was generated on 2026-02-18 11:57 -0500 (Wed, 18 Feb 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble" | 4890 |
| 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 257/2361 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.74.0 (landing page) Ben Bolstad
| nebbiolo2 | 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.74.0 |
| Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz |
| StartedAt: 2026-02-16 21:46:50 -0500 (Mon, 16 Feb 2026) |
| EndedAt: 2026-02-16 21:47:14 -0500 (Mon, 16 Feb 2026) |
| EllapsedTime: 24.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.2 (2025-10-31)
* 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.74.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 ... NOTE
Note: information on .o files is not available
* 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: 2 NOTEs
See
‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.22-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.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.22-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.22-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.22-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.22-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.22-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.22-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.22-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.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 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.248 0.044 0.277
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 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.22-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 478284 25.6 1046725 56 639600 34.2
Vcells 884773 6.8 8388608 64 2081613 15.9
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Mon Feb 16 21:47:05 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Mon Feb 16 21:47:05 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: 0x583f5882f1c0>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Mon Feb 16 21:47:05 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Mon Feb 16 21:47:05 2026"
>
> ColMode(tmp2)
<pointer: 0x583f5882f1c0>
>
>
>
> ### 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,] 98.83461258 0.4720683 -0.97189502 -0.7999858
[2,] -0.23615208 0.1289665 0.05681348 1.2890297
[3,] -0.08949046 -1.2689317 0.31913488 0.8673060
[4,] 0.12416330 -0.7177481 0.01981238 0.7816181
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-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,] 98.83461258 0.4720683 0.97189502 0.7999858
[2,] 0.23615208 0.1289665 0.05681348 1.2890297
[3,] 0.08949046 1.2689317 0.31913488 0.8673060
[4,] 0.12416330 0.7177481 0.01981238 0.7816181
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-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.9415599 0.6870723 0.9858474 0.8944193
[2,] 0.4859548 0.3591190 0.2383558 1.1353545
[3,] 0.2991496 1.1264687 0.5649202 0.9312927
[4,] 0.3523681 0.8472001 0.1407564 0.8840917
>
> 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.22-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,] 223.25021 32.34279 35.83037 34.74418
[2,] 30.09570 28.72016 27.44037 37.64257
[3,] 28.08099 37.53362 30.96834 35.18023
[4,] 28.64784 34.18975 26.42738 34.62253
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x583f594358b0>
> exp(tmp5)
<pointer: 0x583f594358b0>
> log(tmp5,2)
<pointer: 0x583f594358b0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 464.6661
> Min(tmp5)
[1] 53.68814
> mean(tmp5)
[1] 71.50864
> Sum(tmp5)
[1] 14301.73
> Var(tmp5)
[1] 859.0904
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.96950 69.37923 68.51094 70.84709 70.75044 70.09512 71.66642 66.26978
[9] 71.68551 65.91234
> rowSums(tmp5)
[1] 1799.390 1387.585 1370.219 1416.942 1415.009 1401.902 1433.328 1325.396
[9] 1433.710 1318.247
> rowVars(tmp5)
[1] 7844.88605 65.71192 78.69220 114.66699 70.32467 100.63841
[7] 75.20967 95.08142 73.53425 41.03822
> rowSd(tmp5)
[1] 88.571361 8.106289 8.870862 10.708267 8.385981 10.031870 8.672351
[8] 9.750970 8.575211 6.406108
> rowMax(tmp5)
[1] 464.66606 86.30047 90.76291 89.50015 87.03250 89.59912 85.69126
[8] 95.00396 88.91173 84.83074
> rowMin(tmp5)
[1] 56.40172 54.17404 56.91754 53.68814 55.84367 54.58383 56.92143 54.32989
[9] 56.15500 58.27608
>
> colMeans(tmp5)
[1] 103.97603 75.85092 68.03794 72.52677 63.77700 75.50715 68.54283
[8] 67.90684 69.04485 73.55594 71.55353 67.98423 65.35412 73.74851
[15] 70.12780 66.20018 67.91590 67.66340 70.33225 70.56654
> colSums(tmp5)
[1] 1039.7603 758.5092 680.3794 725.2677 637.7700 755.0715 685.4283
[8] 679.0684 690.4485 735.5594 715.5353 679.8423 653.5412 737.4851
[15] 701.2780 662.0018 679.1590 676.6340 703.3225 705.6654
> colVars(tmp5)
[1] 16086.69593 91.72953 65.71433 30.14917 80.53817 68.64490
[7] 153.67353 43.02541 68.95501 83.38063 70.77923 98.68011
[13] 77.50908 55.77925 119.09667 51.11910 57.84582 93.57525
[19] 86.06730 57.77749
> colSd(tmp5)
[1] 126.833339 9.577553 8.106437 5.490826 8.974306 8.285222
[7] 12.396513 6.559376 8.303916 9.131300 8.413039 9.933786
[13] 8.803924 7.468551 10.913142 7.149762 7.605644 9.673430
[19] 9.277246 7.601150
> colMax(tmp5)
[1] 464.66606 95.00396 77.51712 81.07155 85.69126 89.50015 88.91173
[8] 78.37534 86.30047 90.76291 82.29576 84.50209 83.05044 84.88319
[15] 87.03250 78.28723 77.76061 88.49260 89.59912 82.73460
> colMin(tmp5)
[1] 58.27608 59.77724 55.00512 62.09906 56.15467 58.45696 54.17404 57.71539
[9] 59.10589 55.71004 57.09973 54.32989 53.68814 60.46436 56.92143 55.98825
[17] 57.60616 58.37883 54.86759 57.51911
>
>
> ### 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] 89.96950 69.37923 68.51094 70.84709 70.75044 70.09512 71.66642 66.26978
[9] 71.68551 NA
> rowSums(tmp5)
[1] 1799.390 1387.585 1370.219 1416.942 1415.009 1401.902 1433.328 1325.396
[9] 1433.710 NA
> rowVars(tmp5)
[1] 7844.88605 65.71192 78.69220 114.66699 70.32467 100.63841
[7] 75.20967 95.08142 73.53425 42.86957
> rowSd(tmp5)
[1] 88.571361 8.106289 8.870862 10.708267 8.385981 10.031870 8.672351
[8] 9.750970 8.575211 6.547486
> rowMax(tmp5)
[1] 464.66606 86.30047 90.76291 89.50015 87.03250 89.59912 85.69126
[8] 95.00396 88.91173 NA
> rowMin(tmp5)
[1] 56.40172 54.17404 56.91754 53.68814 55.84367 54.58383 56.92143 54.32989
[9] 56.15500 NA
>
> colMeans(tmp5)
[1] 103.97603 75.85092 68.03794 72.52677 63.77700 75.50715 68.54283
[8] 67.90684 69.04485 73.55594 71.55353 67.98423 65.35412 73.74851
[15] NA 66.20018 67.91590 67.66340 70.33225 70.56654
> colSums(tmp5)
[1] 1039.7603 758.5092 680.3794 725.2677 637.7700 755.0715 685.4283
[8] 679.0684 690.4485 735.5594 715.5353 679.8423 653.5412 737.4851
[15] NA 662.0018 679.1590 676.6340 703.3225 705.6654
> colVars(tmp5)
[1] 16086.69593 91.72953 65.71433 30.14917 80.53817 68.64490
[7] 153.67353 43.02541 68.95501 83.38063 70.77923 98.68011
[13] 77.50908 55.77925 NA 51.11910 57.84582 93.57525
[19] 86.06730 57.77749
> colSd(tmp5)
[1] 126.833339 9.577553 8.106437 5.490826 8.974306 8.285222
[7] 12.396513 6.559376 8.303916 9.131300 8.413039 9.933786
[13] 8.803924 7.468551 NA 7.149762 7.605644 9.673430
[19] 9.277246 7.601150
> colMax(tmp5)
[1] 464.66606 95.00396 77.51712 81.07155 85.69126 89.50015 88.91173
[8] 78.37534 86.30047 90.76291 82.29576 84.50209 83.05044 84.88319
[15] NA 78.28723 77.76061 88.49260 89.59912 82.73460
> colMin(tmp5)
[1] 58.27608 59.77724 55.00512 62.09906 56.15467 58.45696 54.17404 57.71539
[9] 59.10589 55.71004 57.09973 54.32989 53.68814 60.46436 NA 55.98825
[17] 57.60616 58.37883 54.86759 57.51911
>
> Max(tmp5,na.rm=TRUE)
[1] 464.6661
> Min(tmp5,na.rm=TRUE)
[1] 53.68814
> mean(tmp5,na.rm=TRUE)
[1] 71.52284
> Sum(tmp5,na.rm=TRUE)
[1] 14233.05
> Var(tmp5,na.rm=TRUE)
[1] 863.3887
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.96950 69.37923 68.51094 70.84709 70.75044 70.09512 71.66642 66.26978
[9] 71.68551 65.76658
> rowSums(tmp5,na.rm=TRUE)
[1] 1799.390 1387.585 1370.219 1416.942 1415.009 1401.902 1433.328 1325.396
[9] 1433.710 1249.565
> rowVars(tmp5,na.rm=TRUE)
[1] 7844.88605 65.71192 78.69220 114.66699 70.32467 100.63841
[7] 75.20967 95.08142 73.53425 42.86957
> rowSd(tmp5,na.rm=TRUE)
[1] 88.571361 8.106289 8.870862 10.708267 8.385981 10.031870 8.672351
[8] 9.750970 8.575211 6.547486
> rowMax(tmp5,na.rm=TRUE)
[1] 464.66606 86.30047 90.76291 89.50015 87.03250 89.59912 85.69126
[8] 95.00396 88.91173 84.83074
> rowMin(tmp5,na.rm=TRUE)
[1] 56.40172 54.17404 56.91754 53.68814 55.84367 54.58383 56.92143 54.32989
[9] 56.15500 58.27608
>
> colMeans(tmp5,na.rm=TRUE)
[1] 103.97603 75.85092 68.03794 72.52677 63.77700 75.50715 68.54283
[8] 67.90684 69.04485 73.55594 71.55353 67.98423 65.35412 73.74851
[15] 70.28846 66.20018 67.91590 67.66340 70.33225 70.56654
> colSums(tmp5,na.rm=TRUE)
[1] 1039.7603 758.5092 680.3794 725.2677 637.7700 755.0715 685.4283
[8] 679.0684 690.4485 735.5594 715.5353 679.8423 653.5412 737.4851
[15] 632.5961 662.0018 679.1590 676.6340 703.3225 705.6654
> colVars(tmp5,na.rm=TRUE)
[1] 16086.69593 91.72953 65.71433 30.14917 80.53817 68.64490
[7] 153.67353 43.02541 68.95501 83.38063 70.77923 98.68011
[13] 77.50908 55.77925 133.69337 51.11910 57.84582 93.57525
[19] 86.06730 57.77749
> colSd(tmp5,na.rm=TRUE)
[1] 126.833339 9.577553 8.106437 5.490826 8.974306 8.285222
[7] 12.396513 6.559376 8.303916 9.131300 8.413039 9.933786
[13] 8.803924 7.468551 11.562585 7.149762 7.605644 9.673430
[19] 9.277246 7.601150
> colMax(tmp5,na.rm=TRUE)
[1] 464.66606 95.00396 77.51712 81.07155 85.69126 89.50015 88.91173
[8] 78.37534 86.30047 90.76291 82.29576 84.50209 83.05044 84.88319
[15] 87.03250 78.28723 77.76061 88.49260 89.59912 82.73460
> colMin(tmp5,na.rm=TRUE)
[1] 58.27608 59.77724 55.00512 62.09906 56.15467 58.45696 54.17404 57.71539
[9] 59.10589 55.71004 57.09973 54.32989 53.68814 60.46436 56.92143 55.98825
[17] 57.60616 58.37883 54.86759 57.51911
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.96950 69.37923 68.51094 70.84709 70.75044 70.09512 71.66642 66.26978
[9] 71.68551 NaN
> rowSums(tmp5,na.rm=TRUE)
[1] 1799.390 1387.585 1370.219 1416.942 1415.009 1401.902 1433.328 1325.396
[9] 1433.710 0.000
> rowVars(tmp5,na.rm=TRUE)
[1] 7844.88605 65.71192 78.69220 114.66699 70.32467 100.63841
[7] 75.20967 95.08142 73.53425 NA
> rowSd(tmp5,na.rm=TRUE)
[1] 88.571361 8.106289 8.870862 10.708267 8.385981 10.031870 8.672351
[8] 9.750970 8.575211 NA
> rowMax(tmp5,na.rm=TRUE)
[1] 464.66606 86.30047 90.76291 89.50015 87.03250 89.59912 85.69126
[8] 95.00396 88.91173 NA
> rowMin(tmp5,na.rm=TRUE)
[1] 56.40172 54.17404 56.91754 53.68814 55.84367 54.58383 56.92143 54.32989
[9] 56.15500 NA
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 109.05381 74.85316 68.75129 72.87393 63.53825 77.40162 68.80829
[8] 67.33042 69.27655 74.23909 72.72745 67.67812 65.88597 73.83437
[15] NaN 66.32977 68.68744 68.62539 71.25618 71.16939
> colSums(tmp5,na.rm=TRUE)
[1] 981.4843 673.6785 618.7616 655.8654 571.8443 696.6146 619.2746 605.9738
[9] 623.4889 668.1518 654.5470 609.1031 592.9738 664.5094 0.0000 596.9679
[17] 618.1869 617.6285 641.3056 640.5245
> colVars(tmp5,na.rm=TRUE)
[1] 17807.46549 91.99613 68.20385 32.56196 89.96417 36.84925
[7] 172.08995 44.66574 76.97044 88.55290 64.12309 109.96095
[13] 84.01544 62.66871 NA 57.32008 58.37978 94.86116
[19] 87.22228 60.91108
> colSd(tmp5,na.rm=TRUE)
[1] 133.444616 9.591461 8.258562 5.706309 9.484944 6.070358
[7] 13.118306 6.683243 8.773280 9.410255 8.007689 10.486227
[13] 9.165994 7.916357 NA 7.571003 7.640667 9.739670
[19] 9.339287 7.804555
> colMax(tmp5,na.rm=TRUE)
[1] 464.66606 95.00396 77.51712 81.07155 85.69126 89.50015 88.91173
[8] 78.37534 86.30047 90.76291 82.29576 84.50209 83.05044 84.88319
[15] -Inf 78.28723 77.76061 88.49260 89.59912 82.73460
> colMin(tmp5,na.rm=TRUE)
[1] 58.44689 59.77724 55.00512 62.09906 56.15467 69.40142 54.17404 57.71539
[9] 59.10589 55.71004 57.09973 54.32989 53.68814 60.46436 Inf 55.98825
[17] 57.60616 58.37883 54.86759 57.51911
>
>
>
>
> 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] 266.1333 126.5701 148.7269 204.9045 273.9666 228.1462 231.7654 153.1804
[9] 271.2545 200.2338
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 266.1333 126.5701 148.7269 204.9045 273.9666 228.1462 231.7654 153.1804
[9] 271.2545 200.2338
>
>
>
> 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.705303e-13 1.421085e-13 -8.526513e-14 1.136868e-13 0.000000e+00
[6] 0.000000e+00 -1.421085e-13 2.842171e-14 1.705303e-13 5.684342e-14
[11] 1.421085e-13 0.000000e+00 1.705303e-13 0.000000e+00 -8.526513e-14
[16] 2.842171e-14 -3.410605e-13 -1.136868e-13 5.684342e-14 -2.273737e-13
>
>
>
>
>
>
>
>
>
>
> ## 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)
+ }
3 16
3 15
8 5
6 19
9 1
7 14
5 4
4 11
7 2
2 20
9 20
3 6
2 15
3 10
9 6
10 8
1 5
8 16
1 9
1 8
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 1.795818
> Min(tmp)
[1] -2.201586
> mean(tmp)
[1] 0.01960474
> Sum(tmp)
[1] 1.960474
> Var(tmp)
[1] 0.8951878
>
> rowMeans(tmp)
[1] 0.01960474
> rowSums(tmp)
[1] 1.960474
> rowVars(tmp)
[1] 0.8951878
> rowSd(tmp)
[1] 0.9461437
> rowMax(tmp)
[1] 1.795818
> rowMin(tmp)
[1] -2.201586
>
> colMeans(tmp)
[1] 0.53845602 0.42394515 1.51567709 -0.13314795 -1.30995055 -0.09979473
[7] -0.16952490 0.55417592 -0.30299176 -1.44370886 -0.85791436 1.62713038
[13] 0.62553958 -0.11106947 -0.17287799 -0.86581776 0.74997422 -0.30726388
[19] 0.56334076 0.39849397 -0.65026383 0.82555118 -0.73294075 1.56512456
[25] -1.93970497 1.00955761 -0.52682949 -0.17801314 1.28392449 0.99689702
[31] 0.12082615 -2.20158612 -1.08035859 0.09582249 -0.91596377 0.24497470
[37] 0.61224921 0.35084333 -1.12118198 -1.27050340 0.70304421 -0.32141005
[43] 0.52679760 -0.50733660 0.21054369 1.09235104 -1.42913498 0.81239140
[49] 0.73063183 0.58578926 -0.15821139 -1.64462201 -0.45604281 0.17559577
[55] -0.43186772 0.57794616 0.91206678 -0.79778219 0.69283447 0.32541991
[61] -1.01856027 -0.01348987 0.62613222 1.42708359 -0.45122752 -0.56767578
[67] -0.51040547 -1.90866098 0.17292449 -0.41654332 0.17733714 0.73977741
[73] -0.47362029 0.99157176 1.61990780 -1.01767764 1.71201646 -0.94056419
[79] -1.10706479 0.11228335 1.76691030 0.21651852 -0.88091289 -1.25604901
[85] -0.52176578 1.10792487 -0.74052007 0.52064909 -1.72158488 1.13006300
[91] -0.34565269 1.36057759 1.10165146 0.02678811 -0.84550298 1.79581816
[97] -0.83987727 1.65335157 0.71587589 -0.74743265
> colSums(tmp)
[1] 0.53845602 0.42394515 1.51567709 -0.13314795 -1.30995055 -0.09979473
[7] -0.16952490 0.55417592 -0.30299176 -1.44370886 -0.85791436 1.62713038
[13] 0.62553958 -0.11106947 -0.17287799 -0.86581776 0.74997422 -0.30726388
[19] 0.56334076 0.39849397 -0.65026383 0.82555118 -0.73294075 1.56512456
[25] -1.93970497 1.00955761 -0.52682949 -0.17801314 1.28392449 0.99689702
[31] 0.12082615 -2.20158612 -1.08035859 0.09582249 -0.91596377 0.24497470
[37] 0.61224921 0.35084333 -1.12118198 -1.27050340 0.70304421 -0.32141005
[43] 0.52679760 -0.50733660 0.21054369 1.09235104 -1.42913498 0.81239140
[49] 0.73063183 0.58578926 -0.15821139 -1.64462201 -0.45604281 0.17559577
[55] -0.43186772 0.57794616 0.91206678 -0.79778219 0.69283447 0.32541991
[61] -1.01856027 -0.01348987 0.62613222 1.42708359 -0.45122752 -0.56767578
[67] -0.51040547 -1.90866098 0.17292449 -0.41654332 0.17733714 0.73977741
[73] -0.47362029 0.99157176 1.61990780 -1.01767764 1.71201646 -0.94056419
[79] -1.10706479 0.11228335 1.76691030 0.21651852 -0.88091289 -1.25604901
[85] -0.52176578 1.10792487 -0.74052007 0.52064909 -1.72158488 1.13006300
[91] -0.34565269 1.36057759 1.10165146 0.02678811 -0.84550298 1.79581816
[97] -0.83987727 1.65335157 0.71587589 -0.74743265
> 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.53845602 0.42394515 1.51567709 -0.13314795 -1.30995055 -0.09979473
[7] -0.16952490 0.55417592 -0.30299176 -1.44370886 -0.85791436 1.62713038
[13] 0.62553958 -0.11106947 -0.17287799 -0.86581776 0.74997422 -0.30726388
[19] 0.56334076 0.39849397 -0.65026383 0.82555118 -0.73294075 1.56512456
[25] -1.93970497 1.00955761 -0.52682949 -0.17801314 1.28392449 0.99689702
[31] 0.12082615 -2.20158612 -1.08035859 0.09582249 -0.91596377 0.24497470
[37] 0.61224921 0.35084333 -1.12118198 -1.27050340 0.70304421 -0.32141005
[43] 0.52679760 -0.50733660 0.21054369 1.09235104 -1.42913498 0.81239140
[49] 0.73063183 0.58578926 -0.15821139 -1.64462201 -0.45604281 0.17559577
[55] -0.43186772 0.57794616 0.91206678 -0.79778219 0.69283447 0.32541991
[61] -1.01856027 -0.01348987 0.62613222 1.42708359 -0.45122752 -0.56767578
[67] -0.51040547 -1.90866098 0.17292449 -0.41654332 0.17733714 0.73977741
[73] -0.47362029 0.99157176 1.61990780 -1.01767764 1.71201646 -0.94056419
[79] -1.10706479 0.11228335 1.76691030 0.21651852 -0.88091289 -1.25604901
[85] -0.52176578 1.10792487 -0.74052007 0.52064909 -1.72158488 1.13006300
[91] -0.34565269 1.36057759 1.10165146 0.02678811 -0.84550298 1.79581816
[97] -0.83987727 1.65335157 0.71587589 -0.74743265
> colMin(tmp)
[1] 0.53845602 0.42394515 1.51567709 -0.13314795 -1.30995055 -0.09979473
[7] -0.16952490 0.55417592 -0.30299176 -1.44370886 -0.85791436 1.62713038
[13] 0.62553958 -0.11106947 -0.17287799 -0.86581776 0.74997422 -0.30726388
[19] 0.56334076 0.39849397 -0.65026383 0.82555118 -0.73294075 1.56512456
[25] -1.93970497 1.00955761 -0.52682949 -0.17801314 1.28392449 0.99689702
[31] 0.12082615 -2.20158612 -1.08035859 0.09582249 -0.91596377 0.24497470
[37] 0.61224921 0.35084333 -1.12118198 -1.27050340 0.70304421 -0.32141005
[43] 0.52679760 -0.50733660 0.21054369 1.09235104 -1.42913498 0.81239140
[49] 0.73063183 0.58578926 -0.15821139 -1.64462201 -0.45604281 0.17559577
[55] -0.43186772 0.57794616 0.91206678 -0.79778219 0.69283447 0.32541991
[61] -1.01856027 -0.01348987 0.62613222 1.42708359 -0.45122752 -0.56767578
[67] -0.51040547 -1.90866098 0.17292449 -0.41654332 0.17733714 0.73977741
[73] -0.47362029 0.99157176 1.61990780 -1.01767764 1.71201646 -0.94056419
[79] -1.10706479 0.11228335 1.76691030 0.21651852 -0.88091289 -1.25604901
[85] -0.52176578 1.10792487 -0.74052007 0.52064909 -1.72158488 1.13006300
[91] -0.34565269 1.36057759 1.10165146 0.02678811 -0.84550298 1.79581816
[97] -0.83987727 1.65335157 0.71587589 -0.74743265
> colMedians(tmp)
[1] 0.53845602 0.42394515 1.51567709 -0.13314795 -1.30995055 -0.09979473
[7] -0.16952490 0.55417592 -0.30299176 -1.44370886 -0.85791436 1.62713038
[13] 0.62553958 -0.11106947 -0.17287799 -0.86581776 0.74997422 -0.30726388
[19] 0.56334076 0.39849397 -0.65026383 0.82555118 -0.73294075 1.56512456
[25] -1.93970497 1.00955761 -0.52682949 -0.17801314 1.28392449 0.99689702
[31] 0.12082615 -2.20158612 -1.08035859 0.09582249 -0.91596377 0.24497470
[37] 0.61224921 0.35084333 -1.12118198 -1.27050340 0.70304421 -0.32141005
[43] 0.52679760 -0.50733660 0.21054369 1.09235104 -1.42913498 0.81239140
[49] 0.73063183 0.58578926 -0.15821139 -1.64462201 -0.45604281 0.17559577
[55] -0.43186772 0.57794616 0.91206678 -0.79778219 0.69283447 0.32541991
[61] -1.01856027 -0.01348987 0.62613222 1.42708359 -0.45122752 -0.56767578
[67] -0.51040547 -1.90866098 0.17292449 -0.41654332 0.17733714 0.73977741
[73] -0.47362029 0.99157176 1.61990780 -1.01767764 1.71201646 -0.94056419
[79] -1.10706479 0.11228335 1.76691030 0.21651852 -0.88091289 -1.25604901
[85] -0.52176578 1.10792487 -0.74052007 0.52064909 -1.72158488 1.13006300
[91] -0.34565269 1.36057759 1.10165146 0.02678811 -0.84550298 1.79581816
[97] -0.83987727 1.65335157 0.71587589 -0.74743265
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.538456 0.4239451 1.515677 -0.1331479 -1.309951 -0.09979473 -0.1695249
[2,] 0.538456 0.4239451 1.515677 -0.1331479 -1.309951 -0.09979473 -0.1695249
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.5541759 -0.3029918 -1.443709 -0.8579144 1.62713 0.6255396 -0.1110695
[2,] 0.5541759 -0.3029918 -1.443709 -0.8579144 1.62713 0.6255396 -0.1110695
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.172878 -0.8658178 0.7499742 -0.3072639 0.5633408 0.398494 -0.6502638
[2,] -0.172878 -0.8658178 0.7499742 -0.3072639 0.5633408 0.398494 -0.6502638
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.8255512 -0.7329407 1.565125 -1.939705 1.009558 -0.5268295 -0.1780131
[2,] 0.8255512 -0.7329407 1.565125 -1.939705 1.009558 -0.5268295 -0.1780131
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 1.283924 0.996897 0.1208262 -2.201586 -1.080359 0.09582249 -0.9159638
[2,] 1.283924 0.996897 0.1208262 -2.201586 -1.080359 0.09582249 -0.9159638
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.2449747 0.6122492 0.3508433 -1.121182 -1.270503 0.7030442 -0.3214101
[2,] 0.2449747 0.6122492 0.3508433 -1.121182 -1.270503 0.7030442 -0.3214101
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.5267976 -0.5073366 0.2105437 1.092351 -1.429135 0.8123914 0.7306318
[2,] 0.5267976 -0.5073366 0.2105437 1.092351 -1.429135 0.8123914 0.7306318
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.5857893 -0.1582114 -1.644622 -0.4560428 0.1755958 -0.4318677 0.5779462
[2,] 0.5857893 -0.1582114 -1.644622 -0.4560428 0.1755958 -0.4318677 0.5779462
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.9120668 -0.7977822 0.6928345 0.3254199 -1.01856 -0.01348987 0.6261322
[2,] 0.9120668 -0.7977822 0.6928345 0.3254199 -1.01856 -0.01348987 0.6261322
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 1.427084 -0.4512275 -0.5676758 -0.5104055 -1.908661 0.1729245 -0.4165433
[2,] 1.427084 -0.4512275 -0.5676758 -0.5104055 -1.908661 0.1729245 -0.4165433
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.1773371 0.7397774 -0.4736203 0.9915718 1.619908 -1.017678 1.712016
[2,] 0.1773371 0.7397774 -0.4736203 0.9915718 1.619908 -1.017678 1.712016
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.9405642 -1.107065 0.1122833 1.76691 0.2165185 -0.8809129 -1.256049
[2,] -0.9405642 -1.107065 0.1122833 1.76691 0.2165185 -0.8809129 -1.256049
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.5217658 1.107925 -0.7405201 0.5206491 -1.721585 1.130063 -0.3456527
[2,] -0.5217658 1.107925 -0.7405201 0.5206491 -1.721585 1.130063 -0.3456527
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 1.360578 1.101651 0.02678811 -0.845503 1.795818 -0.8398773 1.653352
[2,] 1.360578 1.101651 0.02678811 -0.845503 1.795818 -0.8398773 1.653352
[,99] [,100]
[1,] 0.7158759 -0.7474326
[2,] 0.7158759 -0.7474326
>
>
> Max(tmp2)
[1] 2.050845
> Min(tmp2)
[1] -2.226479
> mean(tmp2)
[1] -0.02204794
> Sum(tmp2)
[1] -2.204794
> Var(tmp2)
[1] 0.9547819
>
> rowMeans(tmp2)
[1] 0.004897501 -0.553555637 0.347003756 0.865548219 1.423854317
[6] -0.231732022 0.189469956 -0.858801831 0.245685550 -0.501053063
[11] -0.188402720 -1.532800512 1.508779502 0.758965211 1.881406221
[16] 0.247876803 1.444886734 0.940109852 0.518166351 -0.460935644
[21] -1.814914411 0.806344848 -0.756055097 -0.485899181 0.544859394
[26] -0.733142323 -0.299415128 -0.381566639 0.099816563 -0.938773708
[31] 0.012761334 -1.390093290 -0.114803631 2.050844947 0.260731161
[36] 1.247102720 -0.253834900 1.254081871 0.066313028 -1.528872241
[41] -0.875593386 0.892420195 -1.508736033 -0.183566237 -0.292290836
[46] 0.263762717 0.615095718 0.651847418 -0.133214370 -0.262814719
[51] -1.131935671 0.540123054 0.556307126 1.361724364 -0.727220738
[56] 0.735720423 -1.027780639 0.048301351 0.605482039 0.628793630
[61] 0.316633191 1.248083769 1.738283378 0.114312249 1.060454438
[66] -0.102699580 -2.050726851 1.509671387 -0.832314195 -2.226478536
[71] 0.019493481 0.457050384 -0.383094678 -0.136613688 0.131858349
[76] -1.734870528 -1.928219088 -0.429958023 -0.342213062 -0.029305897
[81] -0.137279949 -0.548646473 -0.834740004 -1.080965283 0.561288455
[86] 0.354874086 -0.580506045 -0.382866022 -0.154067334 -1.245495809
[91] -2.068819839 0.565388762 -1.530184042 1.673191253 1.049005751
[96] 0.294697278 0.087955833 1.677755157 1.004146969 -1.760152595
> rowSums(tmp2)
[1] 0.004897501 -0.553555637 0.347003756 0.865548219 1.423854317
[6] -0.231732022 0.189469956 -0.858801831 0.245685550 -0.501053063
[11] -0.188402720 -1.532800512 1.508779502 0.758965211 1.881406221
[16] 0.247876803 1.444886734 0.940109852 0.518166351 -0.460935644
[21] -1.814914411 0.806344848 -0.756055097 -0.485899181 0.544859394
[26] -0.733142323 -0.299415128 -0.381566639 0.099816563 -0.938773708
[31] 0.012761334 -1.390093290 -0.114803631 2.050844947 0.260731161
[36] 1.247102720 -0.253834900 1.254081871 0.066313028 -1.528872241
[41] -0.875593386 0.892420195 -1.508736033 -0.183566237 -0.292290836
[46] 0.263762717 0.615095718 0.651847418 -0.133214370 -0.262814719
[51] -1.131935671 0.540123054 0.556307126 1.361724364 -0.727220738
[56] 0.735720423 -1.027780639 0.048301351 0.605482039 0.628793630
[61] 0.316633191 1.248083769 1.738283378 0.114312249 1.060454438
[66] -0.102699580 -2.050726851 1.509671387 -0.832314195 -2.226478536
[71] 0.019493481 0.457050384 -0.383094678 -0.136613688 0.131858349
[76] -1.734870528 -1.928219088 -0.429958023 -0.342213062 -0.029305897
[81] -0.137279949 -0.548646473 -0.834740004 -1.080965283 0.561288455
[86] 0.354874086 -0.580506045 -0.382866022 -0.154067334 -1.245495809
[91] -2.068819839 0.565388762 -1.530184042 1.673191253 1.049005751
[96] 0.294697278 0.087955833 1.677755157 1.004146969 -1.760152595
> 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.004897501 -0.553555637 0.347003756 0.865548219 1.423854317
[6] -0.231732022 0.189469956 -0.858801831 0.245685550 -0.501053063
[11] -0.188402720 -1.532800512 1.508779502 0.758965211 1.881406221
[16] 0.247876803 1.444886734 0.940109852 0.518166351 -0.460935644
[21] -1.814914411 0.806344848 -0.756055097 -0.485899181 0.544859394
[26] -0.733142323 -0.299415128 -0.381566639 0.099816563 -0.938773708
[31] 0.012761334 -1.390093290 -0.114803631 2.050844947 0.260731161
[36] 1.247102720 -0.253834900 1.254081871 0.066313028 -1.528872241
[41] -0.875593386 0.892420195 -1.508736033 -0.183566237 -0.292290836
[46] 0.263762717 0.615095718 0.651847418 -0.133214370 -0.262814719
[51] -1.131935671 0.540123054 0.556307126 1.361724364 -0.727220738
[56] 0.735720423 -1.027780639 0.048301351 0.605482039 0.628793630
[61] 0.316633191 1.248083769 1.738283378 0.114312249 1.060454438
[66] -0.102699580 -2.050726851 1.509671387 -0.832314195 -2.226478536
[71] 0.019493481 0.457050384 -0.383094678 -0.136613688 0.131858349
[76] -1.734870528 -1.928219088 -0.429958023 -0.342213062 -0.029305897
[81] -0.137279949 -0.548646473 -0.834740004 -1.080965283 0.561288455
[86] 0.354874086 -0.580506045 -0.382866022 -0.154067334 -1.245495809
[91] -2.068819839 0.565388762 -1.530184042 1.673191253 1.049005751
[96] 0.294697278 0.087955833 1.677755157 1.004146969 -1.760152595
> rowMin(tmp2)
[1] 0.004897501 -0.553555637 0.347003756 0.865548219 1.423854317
[6] -0.231732022 0.189469956 -0.858801831 0.245685550 -0.501053063
[11] -0.188402720 -1.532800512 1.508779502 0.758965211 1.881406221
[16] 0.247876803 1.444886734 0.940109852 0.518166351 -0.460935644
[21] -1.814914411 0.806344848 -0.756055097 -0.485899181 0.544859394
[26] -0.733142323 -0.299415128 -0.381566639 0.099816563 -0.938773708
[31] 0.012761334 -1.390093290 -0.114803631 2.050844947 0.260731161
[36] 1.247102720 -0.253834900 1.254081871 0.066313028 -1.528872241
[41] -0.875593386 0.892420195 -1.508736033 -0.183566237 -0.292290836
[46] 0.263762717 0.615095718 0.651847418 -0.133214370 -0.262814719
[51] -1.131935671 0.540123054 0.556307126 1.361724364 -0.727220738
[56] 0.735720423 -1.027780639 0.048301351 0.605482039 0.628793630
[61] 0.316633191 1.248083769 1.738283378 0.114312249 1.060454438
[66] -0.102699580 -2.050726851 1.509671387 -0.832314195 -2.226478536
[71] 0.019493481 0.457050384 -0.383094678 -0.136613688 0.131858349
[76] -1.734870528 -1.928219088 -0.429958023 -0.342213062 -0.029305897
[81] -0.137279949 -0.548646473 -0.834740004 -1.080965283 0.561288455
[86] 0.354874086 -0.580506045 -0.382866022 -0.154067334 -1.245495809
[91] -2.068819839 0.565388762 -1.530184042 1.673191253 1.049005751
[96] 0.294697278 0.087955833 1.677755157 1.004146969 -1.760152595
>
> colMeans(tmp2)
[1] -0.02204794
> colSums(tmp2)
[1] -2.204794
> colVars(tmp2)
[1] 0.9547819
> colSd(tmp2)
[1] 0.9771294
> colMax(tmp2)
[1] 2.050845
> colMin(tmp2)
[1] -2.226479
> colMedians(tmp2)
[1] 0.008829418
> colRanges(tmp2)
[,1]
[1,] -2.226479
[2,] 2.050845
>
> 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] 1.3575595 1.9157162 1.4156143 -1.7482703 2.5038713 3.0314414
[7] 2.4713350 -0.6691924 2.0421949 1.4408526
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.241791
[2,] -0.791453
[3,] -0.402925
[4,] 1.077284
[5,] 2.520071
>
> rowApply(tmp,sum)
[1] 2.3758101 5.6763678 -2.0228702 1.8418472 -2.9856581 2.4883040
[7] -0.6186959 3.5486791 1.9030388 1.5542994
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 10 2 2 3 10 10 3 8 3 2
[2,] 4 6 9 8 2 7 5 2 6 10
[3,] 6 7 8 9 8 1 1 7 2 7
[4,] 2 1 6 7 3 8 6 1 8 6
[5,] 8 9 10 4 1 2 9 10 5 1
[6,] 5 10 7 5 5 4 8 9 7 4
[7,] 9 5 4 10 6 5 2 4 10 3
[8,] 7 4 5 1 4 3 7 3 4 8
[9,] 3 3 3 6 7 9 4 5 9 9
[10,] 1 8 1 2 9 6 10 6 1 5
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.724492143 2.828531102 -2.613972035 0.557658186 7.105331878
[6] -2.840402278 0.002928462 -5.297213146 1.663402711 -1.727589993
[11] -1.461918355 2.240321118 1.506440685 -2.770678314 -2.042031912
[16] 0.300052186 -1.305380562 -0.334600321 -1.586311246 0.616349287
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.1836495
[2,] -1.1280591
[3,] 0.6399163
[4,] 0.8621336
[5,] 1.5341508
>
> rowApply(tmp,sum)
[1] 6.624410 -8.857243 -6.951379 1.960059 2.789563
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 14 7 18 18 4
[2,] 18 17 11 10 17
[3,] 11 14 7 4 5
[4,] 17 2 19 11 10
[5,] 20 13 20 19 15
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.6399163 1.2928254 0.3648375 0.9766111 3.8410349 -0.55137603
[2,] -1.1280591 0.5683387 -0.1985740 -1.5813932 -0.3000007 -1.62058647
[3,] 0.8621336 -0.2788527 -0.8000592 0.8854050 1.2404341 0.06758877
[4,] 1.5341508 -0.1545449 -0.9913395 -0.1299435 1.6319976 -0.89475085
[5,] -1.1836495 1.4007646 -0.9888368 0.4069789 0.6918660 0.15872230
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -2.0120370 0.2342826 2.061147 -1.524764984 0.6773988 0.5553203
[2,] 0.4705617 -1.4299519 -1.253010 -1.210576972 -0.3140007 -0.7830266
[3,] -0.9886100 -1.7333324 -2.363516 -0.038005720 -0.9314739 -0.2161303
[4,] 1.1151676 -0.9339460 1.634689 1.051391200 -0.3599755 1.0340958
[5,] 1.4178461 -1.4342655 1.584094 -0.005633517 -0.5338671 1.6500619
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.9697386 -1.3222072 0.1729461 -0.6524475 0.1847807 0.1274609
[2,] 0.7430288 -0.3754781 -1.2771449 -1.0975942 0.0226461 0.6744514
[3,] -1.1541132 -1.3338550 -0.3095405 0.1490386 -0.3515673 -0.4238811
[4,] -0.1960332 -0.3965877 -1.0854951 1.3996261 0.1679307 -1.2245386
[5,] 1.1438196 0.6574496 0.4572025 0.5014292 -1.3291708 0.5119071
[,19] [,20]
[1,] 0.48388423 0.10505909
[2,] -0.54570095 1.77882766
[3,] 0.69945079 0.06750751
[4,] -2.29260470 1.05077032
[5,] 0.06865939 -2.38581530
>
>
> 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.22-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.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 654 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-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.22-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 1.555071 -0.1554875 0.9736783 1.511831 0.2123658 0.2961216 -0.2350392
col8 col9 col10 col11 col12 col13 col14
row1 -1.149509 0.1681837 -1.022588 1.295851 -0.05004413 -1.132846 1.311126
col15 col16 col17 col18 col19 col20
row1 -1.222205 -0.4652412 0.3627973 1.251799 1.00285 0.2150137
> tmp[,"col10"]
col10
row1 -1.0225879
row2 0.3660452
row3 -0.5122248
row4 0.3807715
row5 0.3231397
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 1.55507090 -0.1554875 0.9736783 1.511831 0.2123658 0.2961216 -0.2350392
row5 -0.05262135 1.5426769 -0.5721332 1.659210 0.2396840 -1.3860333 1.7396280
col8 col9 col10 col11 col12 col13 col14
row1 -1.149509 0.16818374 -1.0225879 1.2958511 -0.05004413 -1.132846 1.3111256
row5 -1.215399 0.09767148 0.3231397 0.1502574 0.84586945 1.452335 -0.3412813
col15 col16 col17 col18 col19 col20
row1 -1.2222054 -0.46524121 0.3627973 1.251799 1.0028499 0.2150137
row5 0.4477103 0.03007362 1.3228733 1.190135 -0.5650862 0.1829719
> tmp[,c("col6","col20")]
col6 col20
row1 0.2961216 0.2150137
row2 -2.9681989 -2.0972899
row3 -2.0756126 0.0215803
row4 2.0766479 1.9309492
row5 -1.3860333 0.1829719
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.2961216 0.2150137
row5 -1.3860333 0.1829719
>
>
>
>
> 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.34717 48.86976 49.99326 50.46577 49.2885 107.1969 51.37592 49.23795
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.51738 49.31209 50.34167 51.69097 49.3493 51.58323 52.42344 49.35915
col17 col18 col19 col20
row1 49.20278 49.2282 52.3435 104.3348
> tmp[,"col10"]
col10
row1 49.31209
row2 31.04141
row3 29.92594
row4 30.05337
row5 50.02972
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.34717 48.86976 49.99326 50.46577 49.28850 107.1969 51.37592 49.23795
row5 48.71945 50.14410 51.00816 49.27265 49.45712 104.4638 49.26132 49.52745
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.51738 49.31209 50.34167 51.69097 49.34930 51.58323 52.42344 49.35915
row5 50.37631 50.02972 50.00443 49.73542 51.92738 51.23423 49.30852 49.58046
col17 col18 col19 col20
row1 49.20278 49.22820 52.3435 104.3348
row5 50.35987 50.58117 50.8782 104.9283
> tmp[,c("col6","col20")]
col6 col20
row1 107.19694 104.33482
row2 73.54600 75.59642
row3 76.04362 75.92330
row4 76.78126 74.94427
row5 104.46382 104.92829
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 107.1969 104.3348
row5 104.4638 104.9283
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 107.1969 104.3348
row5 104.4638 104.9283
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -1.1902317
[2,] -0.3885803
[3,] -0.4397065
[4,] 0.5032787
[5,] -0.1580411
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.4457448 -0.1643241
[2,] 0.9461464 0.1016002
[3,] -0.1732615 0.7292033
[4,] -0.7590308 -1.3814568
[5,] 3.0889361 -0.1590450
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.1031808 -1.2340151
[2,] -0.5149131 -1.6461553
[3,] -0.5635235 -0.5550685
[4,] 0.8921844 0.3320319
[5,] 1.5546019 0.4095478
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.1031808
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.1031808
[2,] -0.5149131
>
>
>
> 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.8769108 -0.6714727 1.071337 0.2679462 0.1707097 0.1269268 -1.27373049
row1 0.2804158 1.5116306 1.552371 0.1519007 -0.5440019 -0.1917768 -0.02784779
[,8] [,9] [,10] [,11] [,12] [,13]
row3 1.3654516 0.6843188 -1.1251150 -0.58237123 0.05897941 0.4215958
row1 -0.6261715 -0.7444081 -0.3673676 0.04060169 1.51964127 -0.2786631
[,14] [,15] [,16] [,17] [,18] [,19]
row3 0.1128621 -1.0802103 -1.54623923 0.003167436 1.719973 -0.5868168
row1 -1.1507483 -0.8696537 0.07199838 -0.384367493 1.650575 -0.1932616
[,20]
row3 1.91362127
row1 -0.07409614
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.8428376 0.2167849 1.222645 -0.1885293 -0.5753931 -0.202699 -1.37193
[,8] [,9] [,10]
row2 -0.8084827 1.166049 -0.130081
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 1.47108 1.036642 0.4779468 -0.4088141 0.7094919 -1.147638 0.2108612
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.3227444 -0.575698 -2.412048 -1.087926 1.621695 0.2842731 -1.603113
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.8205622 0.8461139 0.2970991 1.480838 -1.978405 0.3174219
>
>
> 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: 0x583f581b9e20>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM36a58c798de584"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM36a58c764cb50c"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM36a58c4ca56833"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM36a58c3b29d70d"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM36a58cddfa603"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM36a58c7abe1e88"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM36a58c6cb41b81"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM36a58c1d7c05d6"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM36a58c4469174f"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM36a58c78870424"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM36a58c6b0e11b5"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM36a58c65459147"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM36a58c25b5392"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM36a58c3c53b5e4"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM36a58c7eeb5957"
>
>
> ### 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: 0x583f5757e9a0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x583f5757e9a0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x583f5757e9a0>
> rowMedians(tmp)
[1] 0.5351556603 -0.1121243071 0.2889041823 -0.2598407262 0.2106806550
[6] -0.3578797424 -0.0521794935 0.0836316071 0.0981426224 0.1228263741
[11] 0.5134736555 0.6857677142 -0.3251960882 0.2950456337 0.2391526758
[16] 0.0604076866 -0.0428365458 0.4605692227 0.3871359238 0.0301692204
[21] -0.0821998568 -0.1083977530 0.1950526100 0.0285747096 0.0863825908
[26] -0.1322716128 0.7010520012 -0.3830701813 0.1813129008 0.2640262824
[31] 0.4253260923 -0.4467994737 0.6281656317 0.2556214517 0.2627760155
[36] -0.2396927466 0.3751492000 -0.0090633480 -0.2781624716 -0.3268973498
[41] 0.4423673408 0.1779359914 0.2495912429 -0.3609823876 -0.0199168021
[46] -0.2532377006 0.3742461973 0.3631162763 0.4822566295 -0.5206608906
[51] 0.0885618731 -0.3032072675 0.1360024590 0.1444601591 -0.2874239870
[56] 0.1500162945 0.3957565062 -0.3212651159 -0.3990457018 0.1958561637
[61] 0.6037491106 -0.0842043365 0.3832840693 -0.2338960194 -0.2313814374
[66] -0.0949634801 0.3624441707 0.3117335845 0.3448279577 -0.2326931986
[71] 0.1369167264 0.0042885586 -0.1010280107 -0.3533913826 0.3824734432
[76] -0.4488593981 -0.0643587508 -0.1503496696 0.3451832413 -0.1168780725
[81] -0.2831972888 0.2073454643 -0.1796766818 -0.1323316028 0.1746954583
[86] 0.1368044896 0.0974220798 0.1967964215 -0.0648710672 -0.2269536612
[91] 0.3199021857 -0.5336496348 -0.0527750994 0.2461589998 0.0955700294
[96] -0.0947816797 0.2539709371 -0.0343989915 0.4597929393 -0.3668271124
[101] -0.1530381051 -0.0040320412 0.2772734678 0.2378355204 0.1552813012
[106] 0.1420852268 -0.1547338399 -0.1854493653 -0.0719220660 -0.3339733488
[111] 0.0181537369 -0.3999546502 0.0495447043 0.1473327677 0.4563964468
[116] -0.0796323595 0.3677260498 -0.3498376218 -0.0974691563 0.0429241410
[121] -0.4038015019 -0.3728635821 -0.3113432138 -0.1848304073 -0.2360858043
[126] 0.2921827935 -0.7123889024 0.8799956054 0.1466522421 -0.1988498371
[131] -0.8799143173 -0.0580907055 -0.2341350204 0.3461628616 0.4377393490
[136] -0.0441577152 -0.0932998313 0.0106699058 0.1459063715 0.1670216289
[141] 0.3149889841 -0.0009616139 -0.0861134968 -0.4133913681 -0.0050788344
[146] -0.0706472011 -0.3187738843 0.2136341596 -0.0567408672 -0.2148032854
[151] -0.1443234815 0.6421508542 0.0900266339 -0.4252390236 -0.1420446314
[156] -0.3291752684 -0.1148551877 0.0197216278 0.0305683622 0.2027716303
[161] 0.0302477294 0.0401560508 0.4632961868 -0.2359991056 0.0503874098
[166] -0.0016204336 0.6608009492 0.1463329635 -0.3919349310 0.3008906437
[171] 0.6786628127 0.0849034327 0.0838922268 0.0443791737 0.0912898238
[176] 0.2762694851 0.0680521119 0.4512075048 -0.5185713149 -0.2420261414
[181] -0.0232967166 0.4021814937 -0.0531746797 -0.3689040203 -0.0523111809
[186] 0.0183816257 -0.0864922233 -0.1319117172 -0.3262115750 0.1596696751
[191] 0.4322672451 0.2729478740 0.2065741728 0.1055905010 0.0036120655
[196] -0.0370771366 0.0514583880 -0.1985625780 -0.3894154806 -0.4818314900
[201] 0.1078761074 -0.3891294225 0.1416226692 0.0465667950 -0.3956688443
[206] 0.4119891047 -0.4052327376 0.4393466400 0.1813566012 0.5700467607
[211] -0.3157808068 0.1947418753 -0.0585281524 0.6798883021 0.0998404762
[216] 0.2498076709 0.3786806474 -0.0709254952 -0.3657377986 0.2138872024
[221] 0.4036917802 0.5462640941 -0.2971406570 0.1681979767 0.4594029258
[226] 0.3499302401 -0.1268640624 -0.0661821129 -0.2166097201 -0.1431504025
>
> proc.time()
user system elapsed
1.225 0.657 1.873
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 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: 0x60e38a1fd1c0>
> .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: 0x60e38a1fd1c0>
> .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: 0x60e38a1fd1c0>
> .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: 0x60e38a1fd1c0>
> 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: 0x60e38a4e0120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60e38a4e0120>
> .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: 0x60e38a4e0120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60e38a4e0120>
> .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: 0x60e38a4e0120>
> 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: 0x60e3891944a0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60e3891944a0>
> .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: 0x60e3891944a0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60e3891944a0>
> .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: 0x60e3891944a0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x60e3891944a0>
> .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: 0x60e3891944a0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x60e3891944a0>
> .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: 0x60e3891944a0>
> 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: 0x60e389230390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x60e389230390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60e389230390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60e389230390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile36a61239842768" "BufferedMatrixFile36a6123b11701d"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile36a61239842768" "BufferedMatrixFile36a6123b11701d"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x60e389aaf650>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60e389aaf650>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60e389aaf650>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60e389aaf650>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x60e389aaf650>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x60e389aaf650>
> .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: 0x60e38ac36430>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60e38ac36430>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60e38ac36430>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x60e38ac36430>
> 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: 0x60e38af2b250>
> .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: 0x60e38af2b250>
> rm(P)
>
> proc.time()
user system elapsed
0.237 0.045 0.271
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 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.24 0.05 0.28