| Back to Build/check report for BioC 3.22: simplified long |
|
This page was generated on 2026-02-20 11:57 -0500 (Fri, 20 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-19 21:55:11 -0500 (Thu, 19 Feb 2026) |
| EndedAt: 2026-02-19 21:55:35 -0500 (Thu, 19 Feb 2026) |
| EllapsedTime: 24.1 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.238 0.038 0.267
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] "Thu Feb 19 21:55:26 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] "Thu Feb 19 21:55:26 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: 0x616eaf5ae370>
>
>
>
> 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] "Thu Feb 19 21:55:26 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] "Thu Feb 19 21:55:27 2026"
>
> ColMode(tmp2)
<pointer: 0x616eaf5ae370>
>
>
>
> ### 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.7262811 -0.1582784 0.6549736 0.1924748
[2,] 0.7994136 0.6473992 0.4187434 1.1426965
[3,] -1.8656809 1.8702775 -1.5998634 0.2662574
[4,] 0.1097032 -0.2156835 -0.7537285 1.6112722
> 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.7262811 0.1582784 0.6549736 0.1924748
[2,] 0.7994136 0.6473992 0.4187434 1.1426965
[3,] 1.8656809 1.8702775 1.5998634 0.2662574
[4,] 0.1097032 0.2156835 0.7537285 1.6112722
> 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.9361100 0.3978422 0.8093044 0.4387195
[2,] 0.8940993 0.8046112 0.6471038 1.0689698
[3,] 1.3658993 1.3675809 1.2648571 0.5160014
[4,] 0.3312148 0.4644173 0.8681754 1.2693590
>
> 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.08738 29.13670 33.74802 29.57967
[2,] 34.74041 33.69351 31.88978 36.83239
[3,] 40.52467 40.54609 39.24843 30.42627
[4,] 28.42185 29.85986 34.43548 39.30486
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x616eb05aa9b0>
> exp(tmp5)
<pointer: 0x616eb05aa9b0>
> log(tmp5,2)
<pointer: 0x616eb05aa9b0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 464.3272
> Min(tmp5)
[1] 53.2294
> mean(tmp5)
[1] 72.35017
> Sum(tmp5)
[1] 14470.03
> Var(tmp5)
[1] 845.3068
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.33715 71.10135 70.91828 68.01962 70.72136 70.84579 71.00139 69.57344
[9] 70.42503 71.55830
> rowSums(tmp5)
[1] 1786.743 1422.027 1418.366 1360.392 1414.427 1416.916 1420.028 1391.469
[9] 1408.501 1431.166
> rowVars(tmp5)
[1] 7842.50514 46.45414 88.56409 70.50834 34.96803 116.38666
[7] 62.56595 68.60483 97.31775 78.54917
> rowSd(tmp5)
[1] 88.557920 6.815728 9.410850 8.396924 5.913378 10.788265 7.909864
[8] 8.282804 9.864976 8.862797
> rowMax(tmp5)
[1] 464.32715 85.53254 84.84322 83.96501 80.99481 90.25310 83.13236
[8] 88.18927 86.08969 86.34560
> rowMin(tmp5)
[1] 58.25169 56.39248 56.92728 55.79906 60.37972 53.89129 53.22940 54.68205
[9] 56.63421 56.25286
>
> colMeans(tmp5)
[1] 110.16531 68.94213 67.93772 68.64896 67.81553 71.80709 72.59309
[8] 69.67058 69.47766 73.16573 73.75853 71.88198 69.01234 69.93612
[15] 66.70976 69.64475 75.48221 70.07598 68.77719 71.50073
> colSums(tmp5)
[1] 1101.6531 689.4213 679.3772 686.4896 678.1553 718.0709 725.9309
[8] 696.7058 694.7766 731.6573 737.5853 718.8198 690.1234 699.3612
[15] 667.0976 696.4475 754.8221 700.7598 687.7719 715.0073
> colVars(tmp5)
[1] 15573.00760 101.59623 54.53923 64.15877 102.04582 40.27921
[7] 76.41907 111.57919 87.87002 105.46401 85.82133 45.47559
[13] 87.08265 42.75393 56.38992 42.86010 36.76841 65.54237
[19] 92.17047 42.67545
> colSd(tmp5)
[1] 124.791857 10.079496 7.385068 8.009917 10.101773 6.346590
[7] 8.741800 10.563105 9.373901 10.269567 9.263980 6.743559
[13] 9.331809 6.538649 7.509322 6.546763 6.063696 8.095824
[19] 9.600545 6.532645
> colMax(tmp5)
[1] 464.32715 84.91841 81.69047 81.80792 84.84322 81.61122 90.25310
[8] 86.30692 83.94812 85.53254 86.34560 83.96501 80.99481 79.35329
[15] 76.63930 79.47054 86.08969 84.51198 88.18927 83.27258
> colMin(tmp5)
[1] 56.25286 53.22940 56.71256 58.67064 54.68205 62.65988 58.38157 56.63421
[9] 58.25169 56.77735 63.60878 63.61453 55.79906 56.39248 53.89129 59.41241
[17] 68.95611 59.62089 58.32865 62.93025
>
>
> ### 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.33715 71.10135 70.91828 68.01962 70.72136 70.84579 71.00139 69.57344
[9] NA 71.55830
> rowSums(tmp5)
[1] 1786.743 1422.027 1418.366 1360.392 1414.427 1416.916 1420.028 1391.469
[9] NA 1431.166
> rowVars(tmp5)
[1] 7842.50514 46.45414 88.56409 70.50834 34.96803 116.38666
[7] 62.56595 68.60483 94.16742 78.54917
> rowSd(tmp5)
[1] 88.557920 6.815728 9.410850 8.396924 5.913378 10.788265 7.909864
[8] 8.282804 9.703990 8.862797
> rowMax(tmp5)
[1] 464.32715 85.53254 84.84322 83.96501 80.99481 90.25310 83.13236
[8] 88.18927 NA 86.34560
> rowMin(tmp5)
[1] 58.25169 56.39248 56.92728 55.79906 60.37972 53.89129 53.22940 54.68205
[9] NA 56.25286
>
> colMeans(tmp5)
[1] 110.16531 68.94213 67.93772 68.64896 67.81553 71.80709 72.59309
[8] 69.67058 69.47766 73.16573 73.75853 71.88198 69.01234 69.93612
[15] 66.70976 69.64475 75.48221 70.07598 NA 71.50073
> colSums(tmp5)
[1] 1101.6531 689.4213 679.3772 686.4896 678.1553 718.0709 725.9309
[8] 696.7058 694.7766 731.6573 737.5853 718.8198 690.1234 699.3612
[15] 667.0976 696.4475 754.8221 700.7598 NA 715.0073
> colVars(tmp5)
[1] 15573.00760 101.59623 54.53923 64.15877 102.04582 40.27921
[7] 76.41907 111.57919 87.87002 105.46401 85.82133 45.47559
[13] 87.08265 42.75393 56.38992 42.86010 36.76841 65.54237
[19] NA 42.67545
> colSd(tmp5)
[1] 124.791857 10.079496 7.385068 8.009917 10.101773 6.346590
[7] 8.741800 10.563105 9.373901 10.269567 9.263980 6.743559
[13] 9.331809 6.538649 7.509322 6.546763 6.063696 8.095824
[19] NA 6.532645
> colMax(tmp5)
[1] 464.32715 84.91841 81.69047 81.80792 84.84322 81.61122 90.25310
[8] 86.30692 83.94812 85.53254 86.34560 83.96501 80.99481 79.35329
[15] 76.63930 79.47054 86.08969 84.51198 NA 83.27258
> colMin(tmp5)
[1] 56.25286 53.22940 56.71256 58.67064 54.68205 62.65988 58.38157 56.63421
[9] 58.25169 56.77735 63.60878 63.61453 55.79906 56.39248 53.89129 59.41241
[17] 68.95611 59.62089 NA 62.93025
>
> Max(tmp5,na.rm=TRUE)
[1] 464.3272
> Min(tmp5,na.rm=TRUE)
[1] 53.2294
> mean(tmp5,na.rm=TRUE)
[1] 72.42063
> Sum(tmp5,na.rm=TRUE)
[1] 14411.71
> Var(tmp5,na.rm=TRUE)
[1] 848.5781
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.33715 71.10135 70.91828 68.01962 70.72136 70.84579 71.00139 69.57344
[9] 71.06169 71.55830
> rowSums(tmp5,na.rm=TRUE)
[1] 1786.743 1422.027 1418.366 1360.392 1414.427 1416.916 1420.028 1391.469
[9] 1350.172 1431.166
> rowVars(tmp5,na.rm=TRUE)
[1] 7842.50514 46.45414 88.56409 70.50834 34.96803 116.38666
[7] 62.56595 68.60483 94.16742 78.54917
> rowSd(tmp5,na.rm=TRUE)
[1] 88.557920 6.815728 9.410850 8.396924 5.913378 10.788265 7.909864
[8] 8.282804 9.703990 8.862797
> rowMax(tmp5,na.rm=TRUE)
[1] 464.32715 85.53254 84.84322 83.96501 80.99481 90.25310 83.13236
[8] 88.18927 86.08969 86.34560
> rowMin(tmp5,na.rm=TRUE)
[1] 58.25169 56.39248 56.92728 55.79906 60.37972 53.89129 53.22940 54.68205
[9] 56.63421 56.25286
>
> colMeans(tmp5,na.rm=TRUE)
[1] 110.16531 68.94213 67.93772 68.64896 67.81553 71.80709 72.59309
[8] 69.67058 69.47766 73.16573 73.75853 71.88198 69.01234 69.93612
[15] 66.70976 69.64475 75.48221 70.07598 69.93814 71.50073
> colSums(tmp5,na.rm=TRUE)
[1] 1101.6531 689.4213 679.3772 686.4896 678.1553 718.0709 725.9309
[8] 696.7058 694.7766 731.6573 737.5853 718.8198 690.1234 699.3612
[15] 667.0976 696.4475 754.8221 700.7598 629.4432 715.0073
> colVars(tmp5,na.rm=TRUE)
[1] 15573.00760 101.59623 54.53923 64.15877 102.04582 40.27921
[7] 76.41907 111.57919 87.87002 105.46401 85.82133 45.47559
[13] 87.08265 42.75393 56.38992 42.86010 36.76841 65.54237
[19] 88.52900 42.67545
> colSd(tmp5,na.rm=TRUE)
[1] 124.791857 10.079496 7.385068 8.009917 10.101773 6.346590
[7] 8.741800 10.563105 9.373901 10.269567 9.263980 6.743559
[13] 9.331809 6.538649 7.509322 6.546763 6.063696 8.095824
[19] 9.408985 6.532645
> colMax(tmp5,na.rm=TRUE)
[1] 464.32715 84.91841 81.69047 81.80792 84.84322 81.61122 90.25310
[8] 86.30692 83.94812 85.53254 86.34560 83.96501 80.99481 79.35329
[15] 76.63930 79.47054 86.08969 84.51198 88.18927 83.27258
> colMin(tmp5,na.rm=TRUE)
[1] 56.25286 53.22940 56.71256 58.67064 54.68205 62.65988 58.38157 56.63421
[9] 58.25169 56.77735 63.60878 63.61453 55.79906 56.39248 53.89129 59.41241
[17] 68.95611 59.62089 59.07858 62.93025
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.33715 71.10135 70.91828 68.01962 70.72136 70.84579 71.00139 69.57344
[9] NaN 71.55830
> rowSums(tmp5,na.rm=TRUE)
[1] 1786.743 1422.027 1418.366 1360.392 1414.427 1416.916 1420.028 1391.469
[9] 0.000 1431.166
> rowVars(tmp5,na.rm=TRUE)
[1] 7842.50514 46.45414 88.56409 70.50834 34.96803 116.38666
[7] 62.56595 68.60483 NA 78.54917
> rowSd(tmp5,na.rm=TRUE)
[1] 88.557920 6.815728 9.410850 8.396924 5.913378 10.788265 7.909864
[8] 8.282804 NA 8.862797
> rowMax(tmp5,na.rm=TRUE)
[1] 464.32715 85.53254 84.84322 83.96501 80.99481 90.25310 83.13236
[8] 88.18927 NA 86.34560
> rowMin(tmp5,na.rm=TRUE)
[1] 58.25169 56.39248 56.92728 55.79906 60.37972 53.89129 53.22940 54.68205
[9] NA 56.25286
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 113.38340 68.72191 68.47382 69.74662 68.14038 71.22965 72.75763
[8] 71.11906 70.54291 72.73391 72.51420 72.53797 69.91187 68.88977
[15] 67.27868 68.55299 74.30360 70.31224 NaN 70.19275
> colSums(tmp5,na.rm=TRUE)
[1] 1020.4506 618.4972 616.2643 627.7196 613.2634 641.0668 654.8187
[8] 640.0715 634.8862 654.6052 652.6278 652.8418 629.2068 620.0079
[15] 605.5081 616.9769 668.7324 632.8101 0.0000 631.7347
> colVars(tmp5,na.rm=TRUE)
[1] 17403.12753 113.75016 58.12339 58.62408 113.61437 41.56294
[7] 85.66688 101.92288 86.08778 116.54920 79.12984 46.31892
[13] 88.86505 35.78108 59.79736 34.80841 25.73688 73.10723
[19] NA 28.76315
> colSd(tmp5,na.rm=TRUE)
[1] 131.920914 10.665372 7.623870 7.656636 10.659004 6.446933
[7] 9.255640 10.095686 9.278350 10.795795 8.895496 6.805800
[13] 9.426826 5.981729 7.732876 5.899865 5.073153 8.550276
[19] NA 5.363129
> colMax(tmp5,na.rm=TRUE)
[1] 464.32715 84.91841 81.69047 81.80792 84.84322 81.61122 90.25310
[8] 86.30692 83.94812 85.53254 86.34560 83.96501 80.99481 74.12714
[15] 76.63930 78.51934 84.64063 84.51198 -Inf 78.37873
> colMin(tmp5,na.rm=TRUE)
[1] 56.25286 53.22940 56.71256 58.67064 54.68205 62.65988 58.38157 56.90342
[9] 58.25169 56.77735 63.60878 63.61453 55.79906 56.39248 53.89129 59.41241
[17] 68.95611 59.62089 Inf 62.93025
>
>
>
>
> 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] 307.5726 312.5940 222.5567 208.1808 200.0471 185.0369 313.9208 146.6161
[9] 373.2830 376.9725
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 307.5726 312.5940 222.5567 208.1808 200.0471 185.0369 313.9208 146.6161
[9] 373.2830 376.9725
>
>
>
> 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.421085e-13 5.684342e-14 -2.273737e-13 5.684342e-14 -1.705303e-13
[6] -1.136868e-13 -7.105427e-14 5.684342e-14 5.684342e-14 5.684342e-14
[11] 5.684342e-13 1.705303e-13 0.000000e+00 -3.979039e-13 1.705303e-13
[16] 7.105427e-14 5.684342e-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)
+ }
8 14
9 15
5 6
3 12
9 1
1 2
8 12
10 4
1 18
6 20
1 15
2 16
8 16
5 19
9 13
10 18
10 15
7 8
1 9
1 7
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.865565
> Min(tmp)
[1] -2.379374
> mean(tmp)
[1] -0.1234856
> Sum(tmp)
[1] -12.34856
> Var(tmp)
[1] 1.019081
>
> rowMeans(tmp)
[1] -0.1234856
> rowSums(tmp)
[1] -12.34856
> rowVars(tmp)
[1] 1.019081
> rowSd(tmp)
[1] 1.009495
> rowMax(tmp)
[1] 1.865565
> rowMin(tmp)
[1] -2.379374
>
> colMeans(tmp)
[1] -0.97528670 -1.60009759 -0.32826950 -1.24300667 0.94102159 -0.75649762
[7] 0.90252191 -1.36387282 -1.21338851 -0.17077483 -0.36401659 -1.39377303
[13] -0.42585457 1.13686246 -1.92842396 -0.76401572 0.63570817 -0.30300686
[19] -0.46116377 1.04503256 0.86439756 1.07108053 -0.85401957 1.33484932
[25] 0.63660725 0.61829298 0.05371851 -0.77609936 1.60208620 0.15820113
[31] -1.92446255 -0.96708047 -0.73147173 0.32034303 -0.76736155 0.07311381
[37] 0.65073203 -0.41828946 -0.10664269 0.20905778 1.44055104 -0.70111917
[43] -0.36406187 -0.26487143 -0.89677636 0.22753538 -1.23559025 -0.43447554
[49] 0.88838656 -0.51805436 0.72094141 1.65535868 1.65296495 1.29875558
[55] 0.09328886 0.23299359 0.76031691 0.32916419 0.27162450 0.31059948
[61] -0.01411787 -0.54883262 1.00329708 -0.06169957 -0.19122137 -2.37937438
[67] -1.19109089 0.57777406 0.67210760 1.45097073 -0.49965774 -1.16532968
[73] -1.87498195 -2.29503509 -0.59996517 -0.46099331 0.14636532 0.56902014
[79] 0.39158895 -0.63321796 1.86556482 -2.13609070 -0.14185333 1.20422799
[85] 1.30987686 -1.61604281 0.76661622 1.54915525 0.65935327 -1.54192150
[91] -0.31623679 -1.20034489 0.99708778 0.12428103 -0.11939889 -1.82101429
[97] -1.50958455 0.11329505 -0.34800053 -0.96741687
> colSums(tmp)
[1] -0.97528670 -1.60009759 -0.32826950 -1.24300667 0.94102159 -0.75649762
[7] 0.90252191 -1.36387282 -1.21338851 -0.17077483 -0.36401659 -1.39377303
[13] -0.42585457 1.13686246 -1.92842396 -0.76401572 0.63570817 -0.30300686
[19] -0.46116377 1.04503256 0.86439756 1.07108053 -0.85401957 1.33484932
[25] 0.63660725 0.61829298 0.05371851 -0.77609936 1.60208620 0.15820113
[31] -1.92446255 -0.96708047 -0.73147173 0.32034303 -0.76736155 0.07311381
[37] 0.65073203 -0.41828946 -0.10664269 0.20905778 1.44055104 -0.70111917
[43] -0.36406187 -0.26487143 -0.89677636 0.22753538 -1.23559025 -0.43447554
[49] 0.88838656 -0.51805436 0.72094141 1.65535868 1.65296495 1.29875558
[55] 0.09328886 0.23299359 0.76031691 0.32916419 0.27162450 0.31059948
[61] -0.01411787 -0.54883262 1.00329708 -0.06169957 -0.19122137 -2.37937438
[67] -1.19109089 0.57777406 0.67210760 1.45097073 -0.49965774 -1.16532968
[73] -1.87498195 -2.29503509 -0.59996517 -0.46099331 0.14636532 0.56902014
[79] 0.39158895 -0.63321796 1.86556482 -2.13609070 -0.14185333 1.20422799
[85] 1.30987686 -1.61604281 0.76661622 1.54915525 0.65935327 -1.54192150
[91] -0.31623679 -1.20034489 0.99708778 0.12428103 -0.11939889 -1.82101429
[97] -1.50958455 0.11329505 -0.34800053 -0.96741687
> 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.97528670 -1.60009759 -0.32826950 -1.24300667 0.94102159 -0.75649762
[7] 0.90252191 -1.36387282 -1.21338851 -0.17077483 -0.36401659 -1.39377303
[13] -0.42585457 1.13686246 -1.92842396 -0.76401572 0.63570817 -0.30300686
[19] -0.46116377 1.04503256 0.86439756 1.07108053 -0.85401957 1.33484932
[25] 0.63660725 0.61829298 0.05371851 -0.77609936 1.60208620 0.15820113
[31] -1.92446255 -0.96708047 -0.73147173 0.32034303 -0.76736155 0.07311381
[37] 0.65073203 -0.41828946 -0.10664269 0.20905778 1.44055104 -0.70111917
[43] -0.36406187 -0.26487143 -0.89677636 0.22753538 -1.23559025 -0.43447554
[49] 0.88838656 -0.51805436 0.72094141 1.65535868 1.65296495 1.29875558
[55] 0.09328886 0.23299359 0.76031691 0.32916419 0.27162450 0.31059948
[61] -0.01411787 -0.54883262 1.00329708 -0.06169957 -0.19122137 -2.37937438
[67] -1.19109089 0.57777406 0.67210760 1.45097073 -0.49965774 -1.16532968
[73] -1.87498195 -2.29503509 -0.59996517 -0.46099331 0.14636532 0.56902014
[79] 0.39158895 -0.63321796 1.86556482 -2.13609070 -0.14185333 1.20422799
[85] 1.30987686 -1.61604281 0.76661622 1.54915525 0.65935327 -1.54192150
[91] -0.31623679 -1.20034489 0.99708778 0.12428103 -0.11939889 -1.82101429
[97] -1.50958455 0.11329505 -0.34800053 -0.96741687
> colMin(tmp)
[1] -0.97528670 -1.60009759 -0.32826950 -1.24300667 0.94102159 -0.75649762
[7] 0.90252191 -1.36387282 -1.21338851 -0.17077483 -0.36401659 -1.39377303
[13] -0.42585457 1.13686246 -1.92842396 -0.76401572 0.63570817 -0.30300686
[19] -0.46116377 1.04503256 0.86439756 1.07108053 -0.85401957 1.33484932
[25] 0.63660725 0.61829298 0.05371851 -0.77609936 1.60208620 0.15820113
[31] -1.92446255 -0.96708047 -0.73147173 0.32034303 -0.76736155 0.07311381
[37] 0.65073203 -0.41828946 -0.10664269 0.20905778 1.44055104 -0.70111917
[43] -0.36406187 -0.26487143 -0.89677636 0.22753538 -1.23559025 -0.43447554
[49] 0.88838656 -0.51805436 0.72094141 1.65535868 1.65296495 1.29875558
[55] 0.09328886 0.23299359 0.76031691 0.32916419 0.27162450 0.31059948
[61] -0.01411787 -0.54883262 1.00329708 -0.06169957 -0.19122137 -2.37937438
[67] -1.19109089 0.57777406 0.67210760 1.45097073 -0.49965774 -1.16532968
[73] -1.87498195 -2.29503509 -0.59996517 -0.46099331 0.14636532 0.56902014
[79] 0.39158895 -0.63321796 1.86556482 -2.13609070 -0.14185333 1.20422799
[85] 1.30987686 -1.61604281 0.76661622 1.54915525 0.65935327 -1.54192150
[91] -0.31623679 -1.20034489 0.99708778 0.12428103 -0.11939889 -1.82101429
[97] -1.50958455 0.11329505 -0.34800053 -0.96741687
> colMedians(tmp)
[1] -0.97528670 -1.60009759 -0.32826950 -1.24300667 0.94102159 -0.75649762
[7] 0.90252191 -1.36387282 -1.21338851 -0.17077483 -0.36401659 -1.39377303
[13] -0.42585457 1.13686246 -1.92842396 -0.76401572 0.63570817 -0.30300686
[19] -0.46116377 1.04503256 0.86439756 1.07108053 -0.85401957 1.33484932
[25] 0.63660725 0.61829298 0.05371851 -0.77609936 1.60208620 0.15820113
[31] -1.92446255 -0.96708047 -0.73147173 0.32034303 -0.76736155 0.07311381
[37] 0.65073203 -0.41828946 -0.10664269 0.20905778 1.44055104 -0.70111917
[43] -0.36406187 -0.26487143 -0.89677636 0.22753538 -1.23559025 -0.43447554
[49] 0.88838656 -0.51805436 0.72094141 1.65535868 1.65296495 1.29875558
[55] 0.09328886 0.23299359 0.76031691 0.32916419 0.27162450 0.31059948
[61] -0.01411787 -0.54883262 1.00329708 -0.06169957 -0.19122137 -2.37937438
[67] -1.19109089 0.57777406 0.67210760 1.45097073 -0.49965774 -1.16532968
[73] -1.87498195 -2.29503509 -0.59996517 -0.46099331 0.14636532 0.56902014
[79] 0.39158895 -0.63321796 1.86556482 -2.13609070 -0.14185333 1.20422799
[85] 1.30987686 -1.61604281 0.76661622 1.54915525 0.65935327 -1.54192150
[91] -0.31623679 -1.20034489 0.99708778 0.12428103 -0.11939889 -1.82101429
[97] -1.50958455 0.11329505 -0.34800053 -0.96741687
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.9752867 -1.600098 -0.3282695 -1.243007 0.9410216 -0.7564976 0.9025219
[2,] -0.9752867 -1.600098 -0.3282695 -1.243007 0.9410216 -0.7564976 0.9025219
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -1.363873 -1.213389 -0.1707748 -0.3640166 -1.393773 -0.4258546 1.136862
[2,] -1.363873 -1.213389 -0.1707748 -0.3640166 -1.393773 -0.4258546 1.136862
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -1.928424 -0.7640157 0.6357082 -0.3030069 -0.4611638 1.045033 0.8643976
[2,] -1.928424 -0.7640157 0.6357082 -0.3030069 -0.4611638 1.045033 0.8643976
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 1.071081 -0.8540196 1.334849 0.6366072 0.618293 0.05371851 -0.7760994
[2,] 1.071081 -0.8540196 1.334849 0.6366072 0.618293 0.05371851 -0.7760994
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 1.602086 0.1582011 -1.924463 -0.9670805 -0.7314717 0.320343 -0.7673616
[2,] 1.602086 0.1582011 -1.924463 -0.9670805 -0.7314717 0.320343 -0.7673616
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.07311381 0.650732 -0.4182895 -0.1066427 0.2090578 1.440551 -0.7011192
[2,] 0.07311381 0.650732 -0.4182895 -0.1066427 0.2090578 1.440551 -0.7011192
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.3640619 -0.2648714 -0.8967764 0.2275354 -1.23559 -0.4344755 0.8883866
[2,] -0.3640619 -0.2648714 -0.8967764 0.2275354 -1.23559 -0.4344755 0.8883866
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.5180544 0.7209414 1.655359 1.652965 1.298756 0.09328886 0.2329936
[2,] -0.5180544 0.7209414 1.655359 1.652965 1.298756 0.09328886 0.2329936
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.7603169 0.3291642 0.2716245 0.3105995 -0.01411787 -0.5488326 1.003297
[2,] 0.7603169 0.3291642 0.2716245 0.3105995 -0.01411787 -0.5488326 1.003297
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.06169957 -0.1912214 -2.379374 -1.191091 0.5777741 0.6721076 1.450971
[2,] -0.06169957 -0.1912214 -2.379374 -1.191091 0.5777741 0.6721076 1.450971
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.4996577 -1.16533 -1.874982 -2.295035 -0.5999652 -0.4609933 0.1463653
[2,] -0.4996577 -1.16533 -1.874982 -2.295035 -0.5999652 -0.4609933 0.1463653
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.5690201 0.3915889 -0.633218 1.865565 -2.136091 -0.1418533 1.204228
[2,] 0.5690201 0.3915889 -0.633218 1.865565 -2.136091 -0.1418533 1.204228
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 1.309877 -1.616043 0.7666162 1.549155 0.6593533 -1.541922 -0.3162368
[2,] 1.309877 -1.616043 0.7666162 1.549155 0.6593533 -1.541922 -0.3162368
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -1.200345 0.9970878 0.124281 -0.1193989 -1.821014 -1.509585 0.1132951
[2,] -1.200345 0.9970878 0.124281 -0.1193989 -1.821014 -1.509585 0.1132951
[,99] [,100]
[1,] -0.3480005 -0.9674169
[2,] -0.3480005 -0.9674169
>
>
> Max(tmp2)
[1] 2.075653
> Min(tmp2)
[1] -2.447836
> mean(tmp2)
[1] -0.1496751
> Sum(tmp2)
[1] -14.96751
> Var(tmp2)
[1] 0.940218
>
> rowMeans(tmp2)
[1] 0.39481467 -2.34403990 0.38461218 0.46034618 0.91063797 0.34827703
[7] -2.02653909 0.33517336 0.47751472 0.84133063 1.40445542 -0.02127786
[13] 0.16941334 0.92696329 0.14150486 -1.56017571 -1.08910791 0.51007511
[19] 0.46444255 -0.23883209 -1.50416937 0.13037615 -1.16192004 -0.25811764
[25] -0.74031822 -0.31103100 -1.71372313 0.21840739 -0.29465922 -0.29839705
[31] 0.25743778 -1.21243646 -0.25233540 -0.56329997 0.17856080 0.66094429
[37] 0.60915539 0.43583785 0.79635886 -0.96672970 -0.82922343 -0.32217072
[43] -0.87027915 -0.20690187 -1.38124996 -2.44783607 -1.49457846 0.09792584
[49] 0.10934982 -0.55328577 1.38504943 1.13564469 1.63230814 0.24246795
[55] 0.91233760 -1.36443922 0.53321179 0.42786214 -1.34489679 0.75845181
[61] 0.39945184 0.44788160 0.51049486 -0.37050878 0.34102513 0.05275299
[67] 0.53399448 -0.22894025 -1.74242974 0.28205855 -0.56422070 0.27669179
[73] 1.26512498 1.82256016 2.07565273 -2.29673498 -0.85511530 -0.80184717
[79] -0.16237320 -0.75647417 -0.96109547 0.14123654 0.74404770 -0.52230871
[85] -0.02769273 1.10660600 1.67408665 -1.22339824 -1.13284943 -0.89593099
[91] 0.36685131 0.53180139 -0.12554429 -2.14281044 -0.42552293 0.09267978
[97] -2.04315116 -0.54607659 -0.15171971 -0.57504397
> rowSums(tmp2)
[1] 0.39481467 -2.34403990 0.38461218 0.46034618 0.91063797 0.34827703
[7] -2.02653909 0.33517336 0.47751472 0.84133063 1.40445542 -0.02127786
[13] 0.16941334 0.92696329 0.14150486 -1.56017571 -1.08910791 0.51007511
[19] 0.46444255 -0.23883209 -1.50416937 0.13037615 -1.16192004 -0.25811764
[25] -0.74031822 -0.31103100 -1.71372313 0.21840739 -0.29465922 -0.29839705
[31] 0.25743778 -1.21243646 -0.25233540 -0.56329997 0.17856080 0.66094429
[37] 0.60915539 0.43583785 0.79635886 -0.96672970 -0.82922343 -0.32217072
[43] -0.87027915 -0.20690187 -1.38124996 -2.44783607 -1.49457846 0.09792584
[49] 0.10934982 -0.55328577 1.38504943 1.13564469 1.63230814 0.24246795
[55] 0.91233760 -1.36443922 0.53321179 0.42786214 -1.34489679 0.75845181
[61] 0.39945184 0.44788160 0.51049486 -0.37050878 0.34102513 0.05275299
[67] 0.53399448 -0.22894025 -1.74242974 0.28205855 -0.56422070 0.27669179
[73] 1.26512498 1.82256016 2.07565273 -2.29673498 -0.85511530 -0.80184717
[79] -0.16237320 -0.75647417 -0.96109547 0.14123654 0.74404770 -0.52230871
[85] -0.02769273 1.10660600 1.67408665 -1.22339824 -1.13284943 -0.89593099
[91] 0.36685131 0.53180139 -0.12554429 -2.14281044 -0.42552293 0.09267978
[97] -2.04315116 -0.54607659 -0.15171971 -0.57504397
> 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.39481467 -2.34403990 0.38461218 0.46034618 0.91063797 0.34827703
[7] -2.02653909 0.33517336 0.47751472 0.84133063 1.40445542 -0.02127786
[13] 0.16941334 0.92696329 0.14150486 -1.56017571 -1.08910791 0.51007511
[19] 0.46444255 -0.23883209 -1.50416937 0.13037615 -1.16192004 -0.25811764
[25] -0.74031822 -0.31103100 -1.71372313 0.21840739 -0.29465922 -0.29839705
[31] 0.25743778 -1.21243646 -0.25233540 -0.56329997 0.17856080 0.66094429
[37] 0.60915539 0.43583785 0.79635886 -0.96672970 -0.82922343 -0.32217072
[43] -0.87027915 -0.20690187 -1.38124996 -2.44783607 -1.49457846 0.09792584
[49] 0.10934982 -0.55328577 1.38504943 1.13564469 1.63230814 0.24246795
[55] 0.91233760 -1.36443922 0.53321179 0.42786214 -1.34489679 0.75845181
[61] 0.39945184 0.44788160 0.51049486 -0.37050878 0.34102513 0.05275299
[67] 0.53399448 -0.22894025 -1.74242974 0.28205855 -0.56422070 0.27669179
[73] 1.26512498 1.82256016 2.07565273 -2.29673498 -0.85511530 -0.80184717
[79] -0.16237320 -0.75647417 -0.96109547 0.14123654 0.74404770 -0.52230871
[85] -0.02769273 1.10660600 1.67408665 -1.22339824 -1.13284943 -0.89593099
[91] 0.36685131 0.53180139 -0.12554429 -2.14281044 -0.42552293 0.09267978
[97] -2.04315116 -0.54607659 -0.15171971 -0.57504397
> rowMin(tmp2)
[1] 0.39481467 -2.34403990 0.38461218 0.46034618 0.91063797 0.34827703
[7] -2.02653909 0.33517336 0.47751472 0.84133063 1.40445542 -0.02127786
[13] 0.16941334 0.92696329 0.14150486 -1.56017571 -1.08910791 0.51007511
[19] 0.46444255 -0.23883209 -1.50416937 0.13037615 -1.16192004 -0.25811764
[25] -0.74031822 -0.31103100 -1.71372313 0.21840739 -0.29465922 -0.29839705
[31] 0.25743778 -1.21243646 -0.25233540 -0.56329997 0.17856080 0.66094429
[37] 0.60915539 0.43583785 0.79635886 -0.96672970 -0.82922343 -0.32217072
[43] -0.87027915 -0.20690187 -1.38124996 -2.44783607 -1.49457846 0.09792584
[49] 0.10934982 -0.55328577 1.38504943 1.13564469 1.63230814 0.24246795
[55] 0.91233760 -1.36443922 0.53321179 0.42786214 -1.34489679 0.75845181
[61] 0.39945184 0.44788160 0.51049486 -0.37050878 0.34102513 0.05275299
[67] 0.53399448 -0.22894025 -1.74242974 0.28205855 -0.56422070 0.27669179
[73] 1.26512498 1.82256016 2.07565273 -2.29673498 -0.85511530 -0.80184717
[79] -0.16237320 -0.75647417 -0.96109547 0.14123654 0.74404770 -0.52230871
[85] -0.02769273 1.10660600 1.67408665 -1.22339824 -1.13284943 -0.89593099
[91] 0.36685131 0.53180139 -0.12554429 -2.14281044 -0.42552293 0.09267978
[97] -2.04315116 -0.54607659 -0.15171971 -0.57504397
>
> colMeans(tmp2)
[1] -0.1496751
> colSums(tmp2)
[1] -14.96751
> colVars(tmp2)
[1] 0.940218
> colSd(tmp2)
[1] 0.9696484
> colMax(tmp2)
[1] 2.075653
> colMin(tmp2)
[1] -2.447836
> colMedians(tmp2)
[1] 0.01573757
> colRanges(tmp2)
[,1]
[1,] -2.447836
[2,] 2.075653
>
> 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.4158958 0.1675610 -1.2452507 -1.3439904 -3.4992638 5.2472280
[7] 6.7003580 0.6760013 4.9773023 -1.0849143
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.41480690
[2,] 0.08710858
[3,] 0.23517707
[4,] 0.73632029
[5,] 1.67136763
>
> rowApply(tmp,sum)
[1] 2.04917168 2.98620716 2.26781947 2.05708927 5.81370060 -3.50207591
[7] 2.03010315 -3.03597870 0.05513406 2.28975642
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 6 9 8 10 6 7 6 1 6 6
[2,] 7 5 3 4 7 5 7 3 10 4
[3,] 8 6 9 8 2 1 5 8 5 1
[4,] 2 3 6 2 4 3 1 9 4 9
[5,] 1 1 7 3 3 9 4 2 9 2
[6,] 10 4 5 5 8 10 3 5 8 3
[7,] 9 10 4 6 9 2 9 10 3 5
[8,] 3 7 2 7 1 8 2 4 7 10
[9,] 4 2 10 9 10 6 10 6 2 8
[10,] 5 8 1 1 5 4 8 7 1 7
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 2.3364175 -2.0470197 0.9775088 -1.0396298 4.3461415 1.0618169
[7] 0.6121405 3.8151068 -1.7841264 1.0896726 1.8490231 0.9532490
[13] 6.1669472 -3.9046315 0.5838661 -4.9741605 -3.5063641 -4.6019802
[19] -0.6826570 1.4656768
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.46016445
[2,] 0.07331159
[3,] 0.44990749
[4,] 0.86340162
[5,] 1.40996128
>
> rowApply(tmp,sum)
[1] 5.892053 1.159229 -6.072537 3.151834 -1.413581
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 9 15 10 19 15
[2,] 13 4 14 10 2
[3,] 5 5 18 16 14
[4,] 1 9 13 9 18
[5,] 15 18 19 20 10
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.07331159 0.61080716 -0.4348983 -1.68141457 0.81882941 0.8090271
[2,] 0.86340162 -1.12163432 -0.9296173 -0.43092745 1.22345736 0.1859902
[3,] -0.46016445 0.31215442 0.8418787 -0.14165721 0.85894869 -0.4934666
[4,] 1.40996128 0.07905804 1.0874035 0.01260432 1.45785140 0.5811677
[5,] 0.44990749 -1.92740499 0.4127421 1.20176512 -0.01294539 -0.0209015
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.2343547 1.4816408 -0.55725481 1.26355827 1.5439858 0.08713618
[2,] -0.8947517 0.1107117 0.74757870 0.97234580 1.9974616 1.15970032
[3,] 0.5193238 0.4680095 -1.12950019 -1.33841946 -0.2529075 -0.83439240
[4,] 0.7564382 -0.1731984 -0.88687342 0.24259685 1.2561664 0.13464414
[5,] 0.4654849 1.9279432 0.04192335 -0.05040889 -2.6956831 0.40616077
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.9508808 0.1662661 1.5134397 -0.4458851 0.5824449 -0.09151443
[2,] 2.2177513 -0.6471040 0.6036192 -2.0709668 -1.1630697 -1.32382028
[3,] 1.3068993 -0.7451014 -1.4391343 -1.4794371 -0.8923501 -1.59116171
[4,] -0.1802698 -1.7634807 0.2582510 -1.1614724 -1.0628354 -0.09362268
[5,] 1.8716856 -0.9152115 -0.3523094 0.1836010 -0.9705538 -1.50186115
[,19] [,20]
[1,] -0.51401673 -0.04993609
[2,] -0.76525570 0.42435841
[3,] -0.24229142 0.66023231
[4,] -0.03174161 1.22918579
[5,] 0.87064850 -0.79816364
>
>
> 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 : 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.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 0.0805606 -1.071226 -0.06697592 1.118058 1.645984 -1.121241 -1.062865
col8 col9 col10 col11 col12 col13 col14
row1 -0.8093369 0.6272145 -1.312279 1.664296 -0.3753584 0.4235273 -0.2457875
col15 col16 col17 col18 col19 col20
row1 0.1608202 -1.19172 0.0275627 0.7529172 0.7032806 -0.8367747
> tmp[,"col10"]
col10
row1 -1.3122794
row2 1.1953516
row3 -0.1131077
row4 -0.2282045
row5 -0.8881011
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 0.0805606 -1.07122647 -0.06697592 1.1180580 1.6459844 -1.1212409 -1.062865
row5 0.2609480 0.09805157 -0.94932726 0.7945217 0.2027983 0.7306132 1.065306
col8 col9 col10 col11 col12 col13 col14
row1 -0.8093369 0.6272145 -1.3122794 1.664296 -0.37535838 0.4235273 -0.2457875
row5 0.1813840 0.7660428 -0.8881011 1.100088 0.07861556 -0.1051929 1.8335410
col15 col16 col17 col18 col19 col20
row1 0.1608202 -1.1917199 0.0275627 0.7529172 0.7032806 -0.8367747
row5 1.7278539 0.2432316 0.3555815 0.6402800 0.6914707 -2.1393958
> tmp[,c("col6","col20")]
col6 col20
row1 -1.1212409 -0.8367747
row2 -1.5660458 0.5095104
row3 0.3485989 -0.7308954
row4 0.2033576 1.1713989
row5 0.7306132 -2.1393958
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -1.1212409 -0.8367747
row5 0.7306132 -2.1393958
>
>
>
>
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105)
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.61292 50.20254 49.5167 50.99526 50.05646 104.4739 50.00841 50.05974
col9 col10 col11 col12 col13 col14 col15 col16
row1 47.67721 50.62348 49.09995 50.11453 50.45883 49.11188 49.78599 48.53778
col17 col18 col19 col20
row1 49.64912 49.17443 47.96127 104.5838
> tmp[,"col10"]
col10
row1 50.62348
row2 29.08197
row3 31.83562
row4 29.74583
row5 49.02918
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.61292 50.20254 49.51670 50.99526 50.05646 104.4739 50.00841 50.05974
row5 49.25631 49.50578 49.21877 52.64795 50.17748 105.6808 49.87794 51.12158
col9 col10 col11 col12 col13 col14 col15 col16
row1 47.67721 50.62348 49.09995 50.11453 50.45883 49.11188 49.78599 48.53778
row5 51.01002 49.02918 49.78786 49.44312 49.67225 48.49109 49.83196 49.51893
col17 col18 col19 col20
row1 49.64912 49.17443 47.96127 104.5838
row5 51.03080 48.23740 51.11735 104.8760
> tmp[,c("col6","col20")]
col6 col20
row1 104.47394 104.58378
row2 75.19827 75.32533
row3 75.20331 73.21423
row4 76.74434 73.62583
row5 105.68081 104.87598
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.4739 104.5838
row5 105.6808 104.8760
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.4739 104.5838
row5 105.6808 104.8760
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -1.3662305
[2,] 0.6308339
[3,] 0.6448460
[4,] -0.3730538
[5,] -0.3246039
> tmp[,c("col17","col7")]
col17 col7
[1,] 1.79028762 -0.21577733
[2,] 2.11879152 -0.06800973
[3,] 1.63001067 -0.52802394
[4,] 0.21979991 -0.06715449
[5,] -0.04523637 -0.62778239
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.67152812 0.2479770
[2,] 0.05993532 1.4175521
[3,] -0.31628080 0.2913655
[4,] 1.67606466 -0.3899519
[5,] 0.58112251 -0.2682110
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.6715281
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.67152812
[2,] 0.05993532
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row3 1.6314660 -0.5184603 0.5966541 -1.049914 0.8757538 1.878793 -0.5932415
row1 0.6163261 -0.6485180 1.4934984 -1.698021 -1.8007722 1.871201 -1.4216022
[,8] [,9] [,10] [,11] [,12] [,13]
row3 0.9912979 -0.6128406 2.1226866 0.09760458 0.04913459 -0.3693992
row1 -0.1663713 0.5328066 -0.2395144 -0.27249570 0.32299373 -1.1602865
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row3 1.139412 -0.4728955 -0.8452633 0.2530231 -0.2441622 -1.01813856 1.363767
row1 -1.800522 0.6085097 0.3695674 0.1745869 0.4103891 0.07847825 -1.932183
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 1.685126 -2.559115 -1.542822 -0.4234754 0.2844088 1.24131 0.8279961
[,8] [,9] [,10]
row2 -0.2096928 -0.2105804 -1.050955
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -1.517921 -0.5172023 -1.611857 0.7644823 -0.1503006 0.7193103 0.7299682
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.4778699 0.7090625 -1.439204 -0.03351174 0.3974004 0.2836075 -0.09653132
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.3529829 -0.3096169 -0.6174324 -0.3220362 0.08583109 0.4766783
>
>
> 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: 0x616eb0b255d0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM34167d678774b5"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM34167d3040a28b"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM34167d357e8a5b"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM34167d616e9864"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM34167d39b8c8cb"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM34167db46b11e"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM34167d99a2d69"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM34167d5525625a"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM34167d5603c23b"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM34167d4493bf99"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM34167d27659e71"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM34167d28b4edaa"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM34167d68a5491f"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM34167d17352b6e"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM34167d7743817f"
>
>
> ### 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: 0x616eb0ab61c0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x616eb0ab61c0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x616eb0ab61c0>
> rowMedians(tmp)
[1] 0.099573644 -0.062308735 -0.170908867 -0.309372801 -0.256599035
[6] 0.092460450 0.053379185 0.193690883 0.682957614 0.106324399
[11] 0.253136020 0.622550164 0.536130453 0.088997697 0.013468423
[16] 0.088462127 -0.131326826 0.357037252 0.135098424 -0.387408634
[21] -0.341033022 -0.158353962 0.163669714 -0.246809885 -0.230150029
[26] 0.208131856 0.192577041 -0.219181400 -0.427988294 -0.043017170
[31] -0.204286792 0.178286620 0.222717956 0.117951084 -0.484431950
[36] 0.208408775 0.162776957 0.096813671 -0.106177273 -0.539801555
[41] -0.276641936 0.380213559 -0.008359897 -0.356544752 0.536570794
[46] -0.324410564 0.155937725 -0.376973148 0.026232062 -0.397056342
[51] 0.543895973 -0.171875246 0.062210012 -0.300038890 0.505486993
[56] 0.144264706 0.040136769 -0.319963187 0.614252672 0.266916317
[61] -0.651840124 -0.226055687 0.042099960 -0.242179777 -0.133378806
[66] -0.221591188 0.366624310 0.109554654 0.072217200 0.205114019
[71] 0.169402797 -0.347471942 0.742343520 -0.085928656 0.074978812
[76] 0.083801138 -0.196669967 -0.440916767 -0.583280912 -0.088332718
[81] 0.559844692 -0.334390807 -0.273829682 0.422105883 -0.121250997
[86] 0.607838201 -0.156199199 -0.117215648 -0.447521885 0.014869721
[91] -0.259065283 0.057642571 -0.545547685 -0.021805490 0.060346967
[96] 0.030435083 0.168381107 -0.147636638 0.109688678 -0.349778497
[101] -0.329807095 -0.009099267 -0.474470449 -0.066947517 0.178562158
[106] -0.262475211 0.334578565 -0.483834004 0.011150581 0.106000277
[111] -0.419026777 0.232762116 -0.015252696 -0.423365530 0.723122174
[116] -0.240602115 0.078192404 0.137002130 -0.431965822 0.167869197
[121] -0.021376245 0.152735490 -0.222206295 0.343667341 0.330946142
[126] 0.436234341 0.053776982 -0.414915187 0.101210797 -0.499890109
[131] -0.160435005 -0.191806465 0.341842761 0.563191457 -0.208296471
[136] 0.430681933 -0.221622690 -0.100207087 -0.585354351 -0.387914953
[141] 0.676571131 -0.563602218 -0.115027941 -0.041165892 -0.077751502
[146] -0.144781257 -0.101663327 -0.109805301 -0.031804171 -0.219104314
[151] 0.446968033 -0.076114119 -0.493824187 0.293070568 -0.173444377
[156] 0.168212593 -0.073798770 0.044616670 0.422788410 0.206844262
[161] -0.463643403 0.003336143 -0.135180835 -0.354612297 -0.029252580
[166] 0.111991908 0.695811809 -0.016756501 -0.285143259 -0.101519941
[171] -0.031261286 -0.360410375 0.010823014 0.231373472 0.037623660
[176] 0.429066226 0.139339632 0.066985734 -0.010352897 -0.024578610
[181] -0.040083286 -0.082928996 0.012053244 0.045564688 -0.023916011
[186] 0.024943788 -0.463103107 0.421095828 -0.041755234 0.258154694
[191] 0.395814926 0.117922594 0.425718149 -0.302897240 0.025731415
[196] -0.084780156 0.035129645 -0.372634155 -0.216581124 -0.007248952
[201] 0.059260002 0.093265598 -0.250376064 0.457018454 -0.263171515
[206] -0.092585211 -0.495357438 0.263837242 -0.304590640 0.177801987
[211] -0.221334021 0.384794932 0.453648929 -0.752646270 0.784379869
[216] -0.532485033 0.409448677 0.917246135 0.020178190 -0.392815376
[221] 0.247273825 -0.129836506 -0.267682251 -0.209814360 0.019120640
[226] 0.846785162 0.244247120 0.220890630 0.275571745 -0.152720209
>
> proc.time()
user system elapsed
1.217 0.646 1.853
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: 0x590380016370>
> .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: 0x590380016370>
> .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: 0x590380016370>
> .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: 0x590380016370>
> 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: 0x59037fffe1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59037fffe1c0>
> .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: 0x59037fffe1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59037fffe1c0>
> .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: 0x59037fffe1c0>
> 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: 0x5903802e1120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5903802e1120>
> .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: 0x5903802e1120>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5903802e1120>
> .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: 0x5903802e1120>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5903802e1120>
> .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: 0x5903802e1120>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5903802e1120>
> .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: 0x5903802e1120>
> 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: 0x59037f031390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x59037f031390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59037f031390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59037f031390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile34173b4311287c" "BufferedMatrixFile34173b606774bd"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile34173b4311287c" "BufferedMatrixFile34173b606774bd"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x59037ef283d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x59037ef283d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x59037ef283d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x59037ef283d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x59037ef283d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x59037ef283d0>
> .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: 0x590380a5dfa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x590380a5dfa0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x590380a5dfa0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x590380a5dfa0>
> 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: 0x59037f235ff0>
> .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: 0x59037f235ff0>
> rm(P)
>
> proc.time()
user system elapsed
0.236 0.050 0.275
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.226 0.050 0.266