| Back to Build/check report for BioC 3.22: simplified long |
|
This page was generated on 2026-03-20 11:57 -0400 (Fri, 20 Mar 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" | 4892 |
| 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-03-19 21:39:47 -0400 (Thu, 19 Mar 2026) |
| EndedAt: 2026-03-19 21:40:11 -0400 (Thu, 19 Mar 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.236 0.049 0.275
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 Mar 19 21:40:02 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 Mar 19 21:40:02 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: 0x5c1b4eb92370>
>
>
>
> 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 Mar 19 21:40:02 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 Mar 19 21:40:02 2026"
>
> ColMode(tmp2)
<pointer: 0x5c1b4eb92370>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.0909824 -0.03844532 1.9176803 0.5742384
[2,] 0.6483784 0.06480785 -0.4129959 0.8302736
[3,] -0.4459841 0.08625312 1.1578930 1.3409160
[4,] -1.1600238 -0.63089057 -2.2784266 -1.0720724
> 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,] 100.0909824 0.03844532 1.9176803 0.5742384
[2,] 0.6483784 0.06480785 0.4129959 0.8302736
[3,] 0.4459841 0.08625312 1.1578930 1.3409160
[4,] 1.1600238 0.63089057 2.2784266 1.0720724
> 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,] 10.0045481 0.1960748 1.3848033 0.7577852
[2,] 0.8052195 0.2545739 0.6426476 0.9111935
[3,] 0.6678204 0.2936888 1.0760544 1.1579793
[4,] 1.0770440 0.7942862 1.5094458 1.0354093
>
> 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,] 225.13646 26.99919 40.76571 33.15209
[2,] 33.70057 27.61055 31.83947 34.94221
[3,] 32.12419 28.02314 36.91844 37.92071
[4,] 36.93046 33.57375 42.37288 36.42617
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5c1b4fb8e9b0>
> exp(tmp5)
<pointer: 0x5c1b4fb8e9b0>
> log(tmp5,2)
<pointer: 0x5c1b4fb8e9b0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.5921
> Min(tmp5)
[1] 52.68346
> mean(tmp5)
[1] 72.14873
> Sum(tmp5)
[1] 14429.75
> Var(tmp5)
[1] 860.9748
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 88.58552 66.31835 74.68190 70.48626 68.85832 70.96950 73.45231 69.48757
[9] 68.53454 70.11303
> rowSums(tmp5)
[1] 1771.710 1326.367 1493.638 1409.725 1377.166 1419.390 1469.046 1389.751
[9] 1370.691 1402.261
> rowVars(tmp5)
[1] 8086.45658 35.48526 71.27656 70.62410 54.85568 81.41939
[7] 66.62174 104.18551 30.40367 46.20054
> rowSd(tmp5)
[1] 89.924727 5.956951 8.442544 8.403814 7.406462 9.023269 8.162214
[8] 10.207130 5.513952 6.797098
> rowMax(tmp5)
[1] 468.59205 75.08559 84.49219 88.19361 81.19545 87.07412 88.62920
[8] 90.45172 78.01081 77.96801
> rowMin(tmp5)
[1] 56.19528 55.40928 57.91332 54.07328 57.01536 53.96310 60.67235 52.68346
[9] 59.97743 58.34432
>
> colMeans(tmp5)
[1] 110.26694 69.26478 73.14314 70.25988 72.64309 72.53225 72.06758
[8] 69.66419 74.05430 68.50049 66.64784 67.98091 69.94930 72.91133
[15] 67.63948 68.77926 68.69311 69.16441 71.44164 67.37066
> colSums(tmp5)
[1] 1102.6694 692.6478 731.4314 702.5988 726.4309 725.3225 720.6758
[8] 696.6419 740.5430 685.0049 666.4784 679.8091 699.4930 729.1133
[15] 676.3948 687.7926 686.9311 691.6441 714.4164 673.7066
> colVars(tmp5)
[1] 15873.07394 76.55333 97.21414 71.64838 59.77503 71.00714
[7] 101.01595 54.93017 122.22914 83.87135 80.79370 62.35187
[13] 128.23869 53.03812 33.90070 70.37822 11.94078 74.23725
[19] 46.56506 66.23927
> colSd(tmp5)
[1] 125.988388 8.749476 9.859723 8.464537 7.731431 8.426573
[7] 10.050669 7.411489 11.055729 9.158130 8.988532 7.896320
[13] 11.324252 7.282728 5.822430 8.389173 3.455543 8.616104
[19] 6.823860 8.138751
> colMax(tmp5)
[1] 468.59205 78.80349 88.19361 81.09582 83.74431 81.96350 87.07412
[8] 84.49219 90.45172 82.49138 83.23307 80.15124 85.63802 87.05782
[15] 76.81302 81.19723 73.24247 88.62920 82.89436 83.10923
> colMin(tmp5)
[1] 63.17546 56.19528 58.34432 53.96310 61.60143 56.57629 58.93290 59.48906
[9] 59.97743 54.07328 56.43223 56.90209 52.68346 62.27257 60.57390 57.01536
[17] 63.77782 57.46208 61.70124 56.02490
>
>
> ### 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] 88.58552 66.31835 74.68190 NA 68.85832 70.96950 73.45231 69.48757
[9] 68.53454 70.11303
> rowSums(tmp5)
[1] 1771.710 1326.367 1493.638 NA 1377.166 1419.390 1469.046 1389.751
[9] 1370.691 1402.261
> rowVars(tmp5)
[1] 8086.45658 35.48526 71.27656 73.34211 54.85568 81.41939
[7] 66.62174 104.18551 30.40367 46.20054
> rowSd(tmp5)
[1] 89.924727 5.956951 8.442544 8.564001 7.406462 9.023269 8.162214
[8] 10.207130 5.513952 6.797098
> rowMax(tmp5)
[1] 468.59205 75.08559 84.49219 NA 81.19545 87.07412 88.62920
[8] 90.45172 78.01081 77.96801
> rowMin(tmp5)
[1] 56.19528 55.40928 57.91332 NA 57.01536 53.96310 60.67235 52.68346
[9] 59.97743 58.34432
>
> colMeans(tmp5)
[1] 110.26694 69.26478 73.14314 70.25988 72.64309 72.53225 72.06758
[8] 69.66419 74.05430 68.50049 66.64784 67.98091 69.94930 72.91133
[15] 67.63948 68.77926 68.69311 69.16441 NA 67.37066
> colSums(tmp5)
[1] 1102.6694 692.6478 731.4314 702.5988 726.4309 725.3225 720.6758
[8] 696.6419 740.5430 685.0049 666.4784 679.8091 699.4930 729.1133
[15] 676.3948 687.7926 686.9311 691.6441 NA 673.7066
> colVars(tmp5)
[1] 15873.07394 76.55333 97.21414 71.64838 59.77503 71.00714
[7] 101.01595 54.93017 122.22914 83.87135 80.79370 62.35187
[13] 128.23869 53.03812 33.90070 70.37822 11.94078 74.23725
[19] NA 66.23927
> colSd(tmp5)
[1] 125.988388 8.749476 9.859723 8.464537 7.731431 8.426573
[7] 10.050669 7.411489 11.055729 9.158130 8.988532 7.896320
[13] 11.324252 7.282728 5.822430 8.389173 3.455543 8.616104
[19] NA 8.138751
> colMax(tmp5)
[1] 468.59205 78.80349 88.19361 81.09582 83.74431 81.96350 87.07412
[8] 84.49219 90.45172 82.49138 83.23307 80.15124 85.63802 87.05782
[15] 76.81302 81.19723 73.24247 88.62920 NA 83.10923
> colMin(tmp5)
[1] 63.17546 56.19528 58.34432 53.96310 61.60143 56.57629 58.93290 59.48906
[9] 59.97743 54.07328 56.43223 56.90209 52.68346 62.27257 60.57390 57.01536
[17] 63.77782 57.46208 NA 56.02490
>
> Max(tmp5,na.rm=TRUE)
[1] 468.5921
> Min(tmp5,na.rm=TRUE)
[1] 52.68346
> mean(tmp5,na.rm=TRUE)
[1] 72.1799
> Sum(tmp5,na.rm=TRUE)
[1] 14363.8
> Var(tmp5,na.rm=TRUE)
[1] 865.1279
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 88.58552 66.31835 74.68190 70.72523 68.85832 70.96950 73.45231 69.48757
[9] 68.53454 70.11303
> rowSums(tmp5,na.rm=TRUE)
[1] 1771.710 1326.367 1493.638 1343.779 1377.166 1419.390 1469.046 1389.751
[9] 1370.691 1402.261
> rowVars(tmp5,na.rm=TRUE)
[1] 8086.45658 35.48526 71.27656 73.34211 54.85568 81.41939
[7] 66.62174 104.18551 30.40367 46.20054
> rowSd(tmp5,na.rm=TRUE)
[1] 89.924727 5.956951 8.442544 8.564001 7.406462 9.023269 8.162214
[8] 10.207130 5.513952 6.797098
> rowMax(tmp5,na.rm=TRUE)
[1] 468.59205 75.08559 84.49219 88.19361 81.19545 87.07412 88.62920
[8] 90.45172 78.01081 77.96801
> rowMin(tmp5,na.rm=TRUE)
[1] 56.19528 55.40928 57.91332 54.07328 57.01536 53.96310 60.67235 52.68346
[9] 59.97743 58.34432
>
> colMeans(tmp5,na.rm=TRUE)
[1] 110.26694 69.26478 73.14314 70.25988 72.64309 72.53225 72.06758
[8] 69.66419 74.05430 68.50049 66.64784 67.98091 69.94930 72.91133
[15] 67.63948 68.77926 68.69311 69.16441 72.05227 67.37066
> colSums(tmp5,na.rm=TRUE)
[1] 1102.6694 692.6478 731.4314 702.5988 726.4309 725.3225 720.6758
[8] 696.6419 740.5430 685.0049 666.4784 679.8091 699.4930 729.1133
[15] 676.3948 687.7926 686.9311 691.6441 648.4705 673.7066
> colVars(tmp5,na.rm=TRUE)
[1] 15873.07394 76.55333 97.21414 71.64838 59.77503 71.00714
[7] 101.01595 54.93017 122.22914 83.87135 80.79370 62.35187
[13] 128.23869 53.03812 33.90070 70.37822 11.94078 74.23725
[19] 48.19081 66.23927
> colSd(tmp5,na.rm=TRUE)
[1] 125.988388 8.749476 9.859723 8.464537 7.731431 8.426573
[7] 10.050669 7.411489 11.055729 9.158130 8.988532 7.896320
[13] 11.324252 7.282728 5.822430 8.389173 3.455543 8.616104
[19] 6.941960 8.138751
> colMax(tmp5,na.rm=TRUE)
[1] 468.59205 78.80349 88.19361 81.09582 83.74431 81.96350 87.07412
[8] 84.49219 90.45172 82.49138 83.23307 80.15124 85.63802 87.05782
[15] 76.81302 81.19723 73.24247 88.62920 82.89436 83.10923
> colMin(tmp5,na.rm=TRUE)
[1] 63.17546 56.19528 58.34432 53.96310 61.60143 56.57629 58.93290 59.48906
[9] 59.97743 54.07328 56.43223 56.90209 52.68346 62.27257 60.57390 57.01536
[17] 63.77782 57.46208 61.70124 56.02490
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 88.58552 66.31835 74.68190 NaN 68.85832 70.96950 73.45231 69.48757
[9] 68.53454 70.11303
> rowSums(tmp5,na.rm=TRUE)
[1] 1771.710 1326.367 1493.638 0.000 1377.166 1419.390 1469.046 1389.751
[9] 1370.691 1402.261
> rowVars(tmp5,na.rm=TRUE)
[1] 8086.45658 35.48526 71.27656 NA 54.85568 81.41939
[7] 66.62174 104.18551 30.40367 46.20054
> rowSd(tmp5,na.rm=TRUE)
[1] 89.924727 5.956951 8.442544 NA 7.406462 9.023269 8.162214
[8] 10.207130 5.513952 6.797098
> rowMax(tmp5,na.rm=TRUE)
[1] 468.59205 75.08559 84.49219 NA 81.19545 87.07412 88.62920
[8] 90.45172 78.01081 77.96801
> rowMin(tmp5,na.rm=TRUE)
[1] 56.19528 55.40928 57.91332 NA 57.01536 53.96310 60.67235 52.68346
[9] 59.97743 58.34432
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 113.97816 69.19649 71.47087 69.64251 72.90555 71.76836 72.53646
[8] 70.16052 73.54571 70.10351 65.63108 67.18000 71.21862 72.35967
[15] 68.20384 68.09541 69.16178 69.22897 NaN 68.22916
> colSums(tmp5,na.rm=TRUE)
[1] 1025.8035 622.7684 643.2378 626.7826 656.1500 645.9153 652.8281
[8] 631.4447 661.9114 630.9316 590.6797 604.6200 640.9676 651.2370
[15] 613.8345 612.8587 622.4560 623.0608 0.0000 614.0625
> colVars(tmp5,na.rm=TRUE)
[1] 17702.25984 86.07004 77.90529 76.31642 66.47191 73.31843
[7] 111.16962 59.02509 134.59776 65.44634 79.26262 62.92954
[13] 126.14289 56.24414 34.55523 73.91454 10.96229 83.47002
[19] NA 66.22767
> colSd(tmp5,na.rm=TRUE)
[1] 133.049840 9.277394 8.826398 8.735927 8.153031 8.562618
[7] 10.543700 7.682779 11.601628 8.089891 8.902956 7.932814
[13] 11.231335 7.499610 5.878370 8.597356 3.310934 9.136193
[19] NA 8.138038
> colMax(tmp5,na.rm=TRUE)
[1] 468.59205 78.80349 84.84849 81.09582 83.74431 81.96350 87.07412
[8] 84.49219 90.45172 82.49138 83.23307 80.15124 85.63802 87.05782
[15] 76.81302 81.19723 73.24247 88.62920 -Inf 83.10923
> colMin(tmp5,na.rm=TRUE)
[1] 63.17546 56.19528 58.34432 53.96310 61.60143 56.57629 58.93290 59.48906
[9] 59.97743 55.56978 56.43223 56.90209 52.68346 62.27257 60.57390 57.01536
[17] 63.77782 57.46208 Inf 56.02490
>
>
>
>
> 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] 275.9409 290.9510 175.4785 203.5124 298.8809 163.3187 313.7847 178.8889
[9] 177.8064 112.1208
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 275.9409 290.9510 175.4785 203.5124 298.8809 163.3187 313.7847 178.8889
[9] 177.8064 112.1208
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] 1.136868e-13 -5.684342e-14 5.684342e-14 5.684342e-14 1.136868e-13
[6] 2.842171e-14 1.136868e-13 -4.263256e-14 0.000000e+00 -1.136868e-13
[11] -2.842171e-14 4.547474e-13 0.000000e+00 1.705303e-13 -1.136868e-13
[16] -7.105427e-14 -5.684342e-14 5.684342e-14 -4.263256e-14 5.684342e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
1 14
10 11
3 13
6 17
6 19
4 18
5 2
5 19
1 4
7 13
10 14
5 18
5 5
7 8
3 14
10 6
5 9
6 6
10 17
1 9
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 2.600177
> Min(tmp)
[1] -2.496877
> mean(tmp)
[1] -0.03882027
> Sum(tmp)
[1] -3.882027
> Var(tmp)
[1] 1.025527
>
> rowMeans(tmp)
[1] -0.03882027
> rowSums(tmp)
[1] -3.882027
> rowVars(tmp)
[1] 1.025527
> rowSd(tmp)
[1] 1.012683
> rowMax(tmp)
[1] 2.600177
> rowMin(tmp)
[1] -2.496877
>
> colMeans(tmp)
[1] -0.82466357 -0.53675771 -0.85987221 0.86542069 -0.11143514 1.53851294
[7] -1.26668300 -1.27704990 -0.21744314 0.35999395 -0.23737140 0.06408918
[13] -0.60556162 -1.34436110 -0.62875127 -0.10383860 2.00393223 -1.32864132
[19] 0.32043833 0.91822916 0.80398740 -1.36103277 0.39191084 2.20630690
[25] -0.62474627 -0.02544488 -1.04508732 -0.06783173 0.88288820 -0.25344608
[31] 2.18227560 0.49440677 -0.98510318 -1.79017582 0.73530276 -0.33822482
[37] 1.72031039 -0.70518020 -0.11489220 -0.36108512 0.77998926 0.77811966
[43] -1.32740727 -1.15468862 0.18155293 0.67985862 -0.93829803 0.92126825
[49] -0.52595585 0.86161387 -0.20267171 0.44265293 -1.74492154 1.39208029
[55] -0.34424254 -0.54453059 0.75086627 1.13871944 -1.00074721 0.99293254
[61] 1.40791778 2.07391124 -0.75946950 0.73615826 0.17524208 -0.28536745
[67] 0.26390663 0.54321838 -0.90572905 -0.34690050 -1.83863250 2.60017721
[73] -0.22839393 -0.57554062 -1.00763363 -1.52951926 0.84447657 -0.25730475
[79] 0.45415628 0.25750090 -0.72850415 0.61020826 -0.48783754 -0.17787235
[85] -0.46668683 0.59492521 -1.32954801 1.32614911 0.26014926 0.19627097
[91] -0.63457387 -0.82902255 0.93042063 -0.86168162 -0.34660695 -0.13673886
[97] -1.00522585 -1.25161330 1.72094917 -2.49687734
> colSums(tmp)
[1] -0.82466357 -0.53675771 -0.85987221 0.86542069 -0.11143514 1.53851294
[7] -1.26668300 -1.27704990 -0.21744314 0.35999395 -0.23737140 0.06408918
[13] -0.60556162 -1.34436110 -0.62875127 -0.10383860 2.00393223 -1.32864132
[19] 0.32043833 0.91822916 0.80398740 -1.36103277 0.39191084 2.20630690
[25] -0.62474627 -0.02544488 -1.04508732 -0.06783173 0.88288820 -0.25344608
[31] 2.18227560 0.49440677 -0.98510318 -1.79017582 0.73530276 -0.33822482
[37] 1.72031039 -0.70518020 -0.11489220 -0.36108512 0.77998926 0.77811966
[43] -1.32740727 -1.15468862 0.18155293 0.67985862 -0.93829803 0.92126825
[49] -0.52595585 0.86161387 -0.20267171 0.44265293 -1.74492154 1.39208029
[55] -0.34424254 -0.54453059 0.75086627 1.13871944 -1.00074721 0.99293254
[61] 1.40791778 2.07391124 -0.75946950 0.73615826 0.17524208 -0.28536745
[67] 0.26390663 0.54321838 -0.90572905 -0.34690050 -1.83863250 2.60017721
[73] -0.22839393 -0.57554062 -1.00763363 -1.52951926 0.84447657 -0.25730475
[79] 0.45415628 0.25750090 -0.72850415 0.61020826 -0.48783754 -0.17787235
[85] -0.46668683 0.59492521 -1.32954801 1.32614911 0.26014926 0.19627097
[91] -0.63457387 -0.82902255 0.93042063 -0.86168162 -0.34660695 -0.13673886
[97] -1.00522585 -1.25161330 1.72094917 -2.49687734
> 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.82466357 -0.53675771 -0.85987221 0.86542069 -0.11143514 1.53851294
[7] -1.26668300 -1.27704990 -0.21744314 0.35999395 -0.23737140 0.06408918
[13] -0.60556162 -1.34436110 -0.62875127 -0.10383860 2.00393223 -1.32864132
[19] 0.32043833 0.91822916 0.80398740 -1.36103277 0.39191084 2.20630690
[25] -0.62474627 -0.02544488 -1.04508732 -0.06783173 0.88288820 -0.25344608
[31] 2.18227560 0.49440677 -0.98510318 -1.79017582 0.73530276 -0.33822482
[37] 1.72031039 -0.70518020 -0.11489220 -0.36108512 0.77998926 0.77811966
[43] -1.32740727 -1.15468862 0.18155293 0.67985862 -0.93829803 0.92126825
[49] -0.52595585 0.86161387 -0.20267171 0.44265293 -1.74492154 1.39208029
[55] -0.34424254 -0.54453059 0.75086627 1.13871944 -1.00074721 0.99293254
[61] 1.40791778 2.07391124 -0.75946950 0.73615826 0.17524208 -0.28536745
[67] 0.26390663 0.54321838 -0.90572905 -0.34690050 -1.83863250 2.60017721
[73] -0.22839393 -0.57554062 -1.00763363 -1.52951926 0.84447657 -0.25730475
[79] 0.45415628 0.25750090 -0.72850415 0.61020826 -0.48783754 -0.17787235
[85] -0.46668683 0.59492521 -1.32954801 1.32614911 0.26014926 0.19627097
[91] -0.63457387 -0.82902255 0.93042063 -0.86168162 -0.34660695 -0.13673886
[97] -1.00522585 -1.25161330 1.72094917 -2.49687734
> colMin(tmp)
[1] -0.82466357 -0.53675771 -0.85987221 0.86542069 -0.11143514 1.53851294
[7] -1.26668300 -1.27704990 -0.21744314 0.35999395 -0.23737140 0.06408918
[13] -0.60556162 -1.34436110 -0.62875127 -0.10383860 2.00393223 -1.32864132
[19] 0.32043833 0.91822916 0.80398740 -1.36103277 0.39191084 2.20630690
[25] -0.62474627 -0.02544488 -1.04508732 -0.06783173 0.88288820 -0.25344608
[31] 2.18227560 0.49440677 -0.98510318 -1.79017582 0.73530276 -0.33822482
[37] 1.72031039 -0.70518020 -0.11489220 -0.36108512 0.77998926 0.77811966
[43] -1.32740727 -1.15468862 0.18155293 0.67985862 -0.93829803 0.92126825
[49] -0.52595585 0.86161387 -0.20267171 0.44265293 -1.74492154 1.39208029
[55] -0.34424254 -0.54453059 0.75086627 1.13871944 -1.00074721 0.99293254
[61] 1.40791778 2.07391124 -0.75946950 0.73615826 0.17524208 -0.28536745
[67] 0.26390663 0.54321838 -0.90572905 -0.34690050 -1.83863250 2.60017721
[73] -0.22839393 -0.57554062 -1.00763363 -1.52951926 0.84447657 -0.25730475
[79] 0.45415628 0.25750090 -0.72850415 0.61020826 -0.48783754 -0.17787235
[85] -0.46668683 0.59492521 -1.32954801 1.32614911 0.26014926 0.19627097
[91] -0.63457387 -0.82902255 0.93042063 -0.86168162 -0.34660695 -0.13673886
[97] -1.00522585 -1.25161330 1.72094917 -2.49687734
> colMedians(tmp)
[1] -0.82466357 -0.53675771 -0.85987221 0.86542069 -0.11143514 1.53851294
[7] -1.26668300 -1.27704990 -0.21744314 0.35999395 -0.23737140 0.06408918
[13] -0.60556162 -1.34436110 -0.62875127 -0.10383860 2.00393223 -1.32864132
[19] 0.32043833 0.91822916 0.80398740 -1.36103277 0.39191084 2.20630690
[25] -0.62474627 -0.02544488 -1.04508732 -0.06783173 0.88288820 -0.25344608
[31] 2.18227560 0.49440677 -0.98510318 -1.79017582 0.73530276 -0.33822482
[37] 1.72031039 -0.70518020 -0.11489220 -0.36108512 0.77998926 0.77811966
[43] -1.32740727 -1.15468862 0.18155293 0.67985862 -0.93829803 0.92126825
[49] -0.52595585 0.86161387 -0.20267171 0.44265293 -1.74492154 1.39208029
[55] -0.34424254 -0.54453059 0.75086627 1.13871944 -1.00074721 0.99293254
[61] 1.40791778 2.07391124 -0.75946950 0.73615826 0.17524208 -0.28536745
[67] 0.26390663 0.54321838 -0.90572905 -0.34690050 -1.83863250 2.60017721
[73] -0.22839393 -0.57554062 -1.00763363 -1.52951926 0.84447657 -0.25730475
[79] 0.45415628 0.25750090 -0.72850415 0.61020826 -0.48783754 -0.17787235
[85] -0.46668683 0.59492521 -1.32954801 1.32614911 0.26014926 0.19627097
[91] -0.63457387 -0.82902255 0.93042063 -0.86168162 -0.34660695 -0.13673886
[97] -1.00522585 -1.25161330 1.72094917 -2.49687734
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.8246636 -0.5367577 -0.8598722 0.8654207 -0.1114351 1.538513 -1.266683
[2,] -0.8246636 -0.5367577 -0.8598722 0.8654207 -0.1114351 1.538513 -1.266683
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -1.27705 -0.2174431 0.359994 -0.2373714 0.06408918 -0.6055616 -1.344361
[2,] -1.27705 -0.2174431 0.359994 -0.2373714 0.06408918 -0.6055616 -1.344361
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.6287513 -0.1038386 2.003932 -1.328641 0.3204383 0.9182292 0.8039874
[2,] -0.6287513 -0.1038386 2.003932 -1.328641 0.3204383 0.9182292 0.8039874
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -1.361033 0.3919108 2.206307 -0.6247463 -0.02544488 -1.045087 -0.06783173
[2,] -1.361033 0.3919108 2.206307 -0.6247463 -0.02544488 -1.045087 -0.06783173
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.8828882 -0.2534461 2.182276 0.4944068 -0.9851032 -1.790176 0.7353028
[2,] 0.8828882 -0.2534461 2.182276 0.4944068 -0.9851032 -1.790176 0.7353028
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.3382248 1.72031 -0.7051802 -0.1148922 -0.3610851 0.7799893 0.7781197
[2,] -0.3382248 1.72031 -0.7051802 -0.1148922 -0.3610851 0.7799893 0.7781197
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -1.327407 -1.154689 0.1815529 0.6798586 -0.938298 0.9212683 -0.5259559
[2,] -1.327407 -1.154689 0.1815529 0.6798586 -0.938298 0.9212683 -0.5259559
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.8616139 -0.2026717 0.4426529 -1.744922 1.39208 -0.3442425 -0.5445306
[2,] 0.8616139 -0.2026717 0.4426529 -1.744922 1.39208 -0.3442425 -0.5445306
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.7508663 1.138719 -1.000747 0.9929325 1.407918 2.073911 -0.7594695
[2,] 0.7508663 1.138719 -1.000747 0.9929325 1.407918 2.073911 -0.7594695
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.7361583 0.1752421 -0.2853674 0.2639066 0.5432184 -0.9057291 -0.3469005
[2,] 0.7361583 0.1752421 -0.2853674 0.2639066 0.5432184 -0.9057291 -0.3469005
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -1.838632 2.600177 -0.2283939 -0.5755406 -1.007634 -1.529519 0.8444766
[2,] -1.838632 2.600177 -0.2283939 -0.5755406 -1.007634 -1.529519 0.8444766
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.2573047 0.4541563 0.2575009 -0.7285042 0.6102083 -0.4878375 -0.1778724
[2,] -0.2573047 0.4541563 0.2575009 -0.7285042 0.6102083 -0.4878375 -0.1778724
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.4666868 0.5949252 -1.329548 1.326149 0.2601493 0.196271 -0.6345739
[2,] -0.4666868 0.5949252 -1.329548 1.326149 0.2601493 0.196271 -0.6345739
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.8290226 0.9304206 -0.8616816 -0.3466069 -0.1367389 -1.005226 -1.251613
[2,] -0.8290226 0.9304206 -0.8616816 -0.3466069 -0.1367389 -1.005226 -1.251613
[,99] [,100]
[1,] 1.720949 -2.496877
[2,] 1.720949 -2.496877
>
>
> Max(tmp2)
[1] 3.477949
> Min(tmp2)
[1] -2.240675
> mean(tmp2)
[1] 0.1619608
> Sum(tmp2)
[1] 16.19608
> Var(tmp2)
[1] 1.032482
>
> rowMeans(tmp2)
[1] 0.524601173 -1.331071455 -0.607987149 3.477949147 0.097408977
[6] 0.547986662 1.355476303 1.291491779 0.555897170 0.947543264
[11] -0.873414054 -1.135984141 0.603525891 0.153968942 0.182355224
[16] -0.352393968 -1.782792841 -0.369912748 -0.557456494 -1.246508200
[21] 0.446178300 -0.397182138 -0.339349992 0.724745942 -0.283398729
[26] -0.063777377 1.378620294 1.329828906 -1.308807124 -0.466068299
[31] 1.605647682 1.033845296 -0.069453091 1.161087430 0.599069442
[36] 1.247566289 -0.213621371 0.561852342 -1.726362214 -0.389623429
[41] 0.799019395 0.595288542 2.711641044 0.896318403 0.102640963
[46] -0.583753947 1.572080503 0.917485217 -0.375069127 -0.364861034
[51] 1.687220113 -2.240674794 -0.247023745 -1.063378260 -0.699940089
[56] -0.883600739 1.468020007 0.984990526 0.111153006 0.039331879
[61] 1.163752423 0.309865728 -2.154673843 1.913911500 -0.002026612
[66] 1.028072079 0.495575353 -1.179863875 -1.108802935 0.210793138
[71] 0.102166914 0.653602580 -0.676485251 1.444387661 0.286323151
[76] 1.165495939 0.550535942 -0.991583889 0.056486273 0.131974952
[81] 0.169853263 0.470327553 -1.732160524 0.774376416 1.229881263
[86] -1.112526655 0.723990938 -0.458408297 0.645055737 -0.021836123
[91] -0.300704587 -0.841736998 -0.421496339 -0.993272260 -0.812770268
[96] 0.205958361 1.365707879 0.737535648 0.178195801 1.252233036
> rowSums(tmp2)
[1] 0.524601173 -1.331071455 -0.607987149 3.477949147 0.097408977
[6] 0.547986662 1.355476303 1.291491779 0.555897170 0.947543264
[11] -0.873414054 -1.135984141 0.603525891 0.153968942 0.182355224
[16] -0.352393968 -1.782792841 -0.369912748 -0.557456494 -1.246508200
[21] 0.446178300 -0.397182138 -0.339349992 0.724745942 -0.283398729
[26] -0.063777377 1.378620294 1.329828906 -1.308807124 -0.466068299
[31] 1.605647682 1.033845296 -0.069453091 1.161087430 0.599069442
[36] 1.247566289 -0.213621371 0.561852342 -1.726362214 -0.389623429
[41] 0.799019395 0.595288542 2.711641044 0.896318403 0.102640963
[46] -0.583753947 1.572080503 0.917485217 -0.375069127 -0.364861034
[51] 1.687220113 -2.240674794 -0.247023745 -1.063378260 -0.699940089
[56] -0.883600739 1.468020007 0.984990526 0.111153006 0.039331879
[61] 1.163752423 0.309865728 -2.154673843 1.913911500 -0.002026612
[66] 1.028072079 0.495575353 -1.179863875 -1.108802935 0.210793138
[71] 0.102166914 0.653602580 -0.676485251 1.444387661 0.286323151
[76] 1.165495939 0.550535942 -0.991583889 0.056486273 0.131974952
[81] 0.169853263 0.470327553 -1.732160524 0.774376416 1.229881263
[86] -1.112526655 0.723990938 -0.458408297 0.645055737 -0.021836123
[91] -0.300704587 -0.841736998 -0.421496339 -0.993272260 -0.812770268
[96] 0.205958361 1.365707879 0.737535648 0.178195801 1.252233036
> 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.524601173 -1.331071455 -0.607987149 3.477949147 0.097408977
[6] 0.547986662 1.355476303 1.291491779 0.555897170 0.947543264
[11] -0.873414054 -1.135984141 0.603525891 0.153968942 0.182355224
[16] -0.352393968 -1.782792841 -0.369912748 -0.557456494 -1.246508200
[21] 0.446178300 -0.397182138 -0.339349992 0.724745942 -0.283398729
[26] -0.063777377 1.378620294 1.329828906 -1.308807124 -0.466068299
[31] 1.605647682 1.033845296 -0.069453091 1.161087430 0.599069442
[36] 1.247566289 -0.213621371 0.561852342 -1.726362214 -0.389623429
[41] 0.799019395 0.595288542 2.711641044 0.896318403 0.102640963
[46] -0.583753947 1.572080503 0.917485217 -0.375069127 -0.364861034
[51] 1.687220113 -2.240674794 -0.247023745 -1.063378260 -0.699940089
[56] -0.883600739 1.468020007 0.984990526 0.111153006 0.039331879
[61] 1.163752423 0.309865728 -2.154673843 1.913911500 -0.002026612
[66] 1.028072079 0.495575353 -1.179863875 -1.108802935 0.210793138
[71] 0.102166914 0.653602580 -0.676485251 1.444387661 0.286323151
[76] 1.165495939 0.550535942 -0.991583889 0.056486273 0.131974952
[81] 0.169853263 0.470327553 -1.732160524 0.774376416 1.229881263
[86] -1.112526655 0.723990938 -0.458408297 0.645055737 -0.021836123
[91] -0.300704587 -0.841736998 -0.421496339 -0.993272260 -0.812770268
[96] 0.205958361 1.365707879 0.737535648 0.178195801 1.252233036
> rowMin(tmp2)
[1] 0.524601173 -1.331071455 -0.607987149 3.477949147 0.097408977
[6] 0.547986662 1.355476303 1.291491779 0.555897170 0.947543264
[11] -0.873414054 -1.135984141 0.603525891 0.153968942 0.182355224
[16] -0.352393968 -1.782792841 -0.369912748 -0.557456494 -1.246508200
[21] 0.446178300 -0.397182138 -0.339349992 0.724745942 -0.283398729
[26] -0.063777377 1.378620294 1.329828906 -1.308807124 -0.466068299
[31] 1.605647682 1.033845296 -0.069453091 1.161087430 0.599069442
[36] 1.247566289 -0.213621371 0.561852342 -1.726362214 -0.389623429
[41] 0.799019395 0.595288542 2.711641044 0.896318403 0.102640963
[46] -0.583753947 1.572080503 0.917485217 -0.375069127 -0.364861034
[51] 1.687220113 -2.240674794 -0.247023745 -1.063378260 -0.699940089
[56] -0.883600739 1.468020007 0.984990526 0.111153006 0.039331879
[61] 1.163752423 0.309865728 -2.154673843 1.913911500 -0.002026612
[66] 1.028072079 0.495575353 -1.179863875 -1.108802935 0.210793138
[71] 0.102166914 0.653602580 -0.676485251 1.444387661 0.286323151
[76] 1.165495939 0.550535942 -0.991583889 0.056486273 0.131974952
[81] 0.169853263 0.470327553 -1.732160524 0.774376416 1.229881263
[86] -1.112526655 0.723990938 -0.458408297 0.645055737 -0.021836123
[91] -0.300704587 -0.841736998 -0.421496339 -0.993272260 -0.812770268
[96] 0.205958361 1.365707879 0.737535648 0.178195801 1.252233036
>
> colMeans(tmp2)
[1] 0.1619608
> colSums(tmp2)
[1] 16.19608
> colVars(tmp2)
[1] 1.032482
> colSd(tmp2)
[1] 1.016111
> colMax(tmp2)
[1] 3.477949
> colMin(tmp2)
[1] -2.240675
> colMedians(tmp2)
[1] 0.1619111
> colRanges(tmp2)
[,1]
[1,] -2.240675
[2,] 3.477949
>
> 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.2285634 0.6644173 2.9159389 0.4631682 -2.5206896 6.9656267
[7] 2.6788545 -2.0842557 -0.6679790 -2.9668083
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.92767294
[2,] -0.09592167
[3,] 0.10825066
[4,] 0.34169879
[5,] 1.08301547
>
> rowApply(tmp,sum)
[1] 0.2644140 0.9847259 -2.7285490 -1.4095607 -0.1770220 1.5727699
[7] -1.6417187 1.0523247 3.2211882 5.5382641
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 5 7 5 2 10 6 6 6 5 5
[2,] 7 1 2 3 6 3 9 8 1 9
[3,] 9 8 9 1 5 10 7 1 7 10
[4,] 1 4 7 9 4 7 10 4 3 4
[5,] 8 6 1 8 9 4 2 7 4 2
[6,] 3 10 10 10 8 5 8 5 9 6
[7,] 6 5 6 7 7 9 4 9 8 1
[8,] 2 2 4 5 2 8 1 3 10 7
[9,] 4 3 8 4 3 2 5 10 2 3
[10,] 10 9 3 6 1 1 3 2 6 8
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 1.3522824 -2.1339659 2.3319298 -0.6681985 -4.1703476 -0.8549223
[7] -2.2541073 4.7114540 -2.7806826 1.4028649 -4.0622640 0.5056073
[13] -4.6318314 2.8516613 3.3702521 2.4510604 1.0477628 -1.4492525
[19] -1.5366958 -1.8549850
> colApply(tmp,quantile)[,1]
[,1]
[1,] 0.02126363
[2,] 0.23333290
[3,] 0.29649311
[4,] 0.38450975
[5,] 0.41668303
>
> rowApply(tmp,sum)
[1] -4.002542 5.140409 -4.359317 3.153151 -6.304080
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 15 11 15 10 12
[2,] 6 17 4 13 4
[3,] 12 16 8 9 20
[4,] 16 3 10 4 18
[5,] 7 10 1 8 6
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.23333290 -0.7912492 -0.05730809 0.3353194 -0.7325806 -1.2658673
[2,] 0.41668303 1.1457249 0.80255838 -0.9048533 0.3503637 1.6590723
[3,] 0.38450975 -1.3797790 -0.19655219 -0.1741515 -2.7796951 -1.4543799
[4,] 0.29649311 0.4190960 0.04318966 -0.7360460 -0.0664476 0.5070083
[5,] 0.02126363 -1.5277585 1.74004208 0.8115330 -0.9419880 -0.3007556
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.3449063 1.88383452 0.03396358 -0.60321837 -0.59782871 1.8069072
[2,] -0.4123192 0.02763604 -2.57805179 0.64040434 -0.01239877 0.7051280
[3,] -0.6592308 0.83182407 -0.04006197 1.05010486 -2.36016424 -0.7120277
[4,] -0.8206494 1.65030142 -0.35588482 0.38319642 1.31239794 -0.9462261
[5,] -0.7068142 0.31785794 0.15935242 -0.06762238 -2.40427018 -0.3481740
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -1.278141759 -0.4634862 2.1154875 -0.2527799 -1.2843510 -1.6784617
[2,] -0.084511797 0.5773769 -1.1483451 2.0031609 1.8143312 0.5938479
[3,] 0.009280835 1.2106690 2.5665772 -0.1837464 -0.0242634 0.1234838
[4,] -1.198753751 0.8020819 0.4192898 0.5870525 0.3579315 1.3531492
[5,] -2.079704965 0.7250198 -0.5827573 0.2973733 0.1841145 -1.8412718
[,19] [,20]
[1,] 0.0002629429 -1.7512830
[2,] -0.2816071300 -0.1737911
[3,] 0.5423020837 -1.1140160
[4,] -0.6071538210 -0.2468748
[5,] -1.1904998419 1.4309798
>
>
> 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 : 565 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.09037569 1.414756 -0.4739536 0.02963246 0.5690657 0.3711565 0.2935087
col8 col9 col10 col11 col12 col13 col14 col15
row1 0.461594 0.9008568 0.1589456 1.462842 -1.060567 1.412402 0.9558757 0.49075
col16 col17 col18 col19 col20
row1 0.773486 -0.6236547 -0.8335153 -0.2215414 0.1113199
> tmp[,"col10"]
col10
row1 0.15894557
row2 -0.84135100
row3 -0.38339633
row4 -0.01008692
row5 0.39827121
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 0.09037569 1.414756 -0.4739536 0.02963246 0.5690657 0.3711565
row5 1.67249760 -1.096206 0.6917421 -0.01742080 -0.9015682 1.7333531
col7 col8 col9 col10 col11 col12 col13
row1 0.2935087 0.461594 0.9008568 0.1589456 1.4628423 -1.06056681 1.4124025
row5 -0.5762919 2.445642 -0.3859349 0.3982712 -0.5083553 0.06130972 -0.0969305
col14 col15 col16 col17 col18 col19
row1 0.9558757 0.4907500 0.77348601 -0.6236547 -0.8335153 -0.2215414
row5 -0.8845932 -0.4707643 0.05217837 1.0066246 1.3596467 0.4090920
col20
row1 0.1113199
row5 -0.3910803
> tmp[,c("col6","col20")]
col6 col20
row1 0.3711565 0.11131994
row2 -0.4465968 0.96621153
row3 0.2604276 1.45876022
row4 -0.6211210 -0.04712817
row5 1.7333531 -0.39108028
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.3711565 0.1113199
row5 1.7333531 -0.3910803
>
>
>
>
> 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.40706 49.35141 49.68046 50.49749 50.6658 103.5626 47.51155 49.70717
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.35187 50.32956 50.56313 48.91452 49.1079 49.5557 49.78864 50.67612
col17 col18 col19 col20
row1 50.47664 50.77695 50.87039 103.1608
> tmp[,"col10"]
col10
row1 50.32956
row2 30.16333
row3 28.65124
row4 29.79540
row5 50.27876
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.40706 49.35141 49.68046 50.49749 50.66580 103.5626 47.51155 49.70717
row5 49.44912 50.29865 49.84457 49.09627 51.26676 106.1806 50.21472 50.81191
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.35187 50.32956 50.56313 48.91452 49.10790 49.55570 49.78864 50.67612
row5 51.04511 50.27876 50.93101 48.72058 49.68856 50.54039 47.98559 49.70735
col17 col18 col19 col20
row1 50.47664 50.77695 50.87039 103.1608
row5 49.58135 49.28267 49.55136 104.7891
> tmp[,c("col6","col20")]
col6 col20
row1 103.56263 103.16080
row2 73.94895 75.55488
row3 73.50191 75.53799
row4 74.27633 75.02678
row5 106.18057 104.78907
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 103.5626 103.1608
row5 106.1806 104.7891
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 103.5626 103.1608
row5 106.1806 104.7891
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.05911059
[2,] -0.53925062
[3,] 1.82129152
[4,] 0.75562513
[5,] 0.20000966
> tmp[,c("col17","col7")]
col17 col7
[1,] 1.1694414 0.3475644
[2,] -1.7218032 0.1257290
[3,] 0.1659528 1.3908948
[4,] 0.1245245 0.5543594
[5,] 1.3985777 0.7092319
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -2.4061713 -0.9343949
[2,] 0.3122360 1.8104742
[3,] -0.8480307 -1.1607101
[4,] -0.1926302 1.6098421
[5,] 0.1270692 -1.6729611
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -2.406171
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -2.406171
[2,] 0.312236
>
>
>
> 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.4509591 -0.6632449 0.9529471 0.5448095 0.1128438 0.9861984 1.4004472
row1 -0.2461269 -1.4163370 -0.9736517 -0.3155872 -1.0796241 0.9647902 0.7643037
[,8] [,9] [,10] [,11] [,12] [,13]
row3 -0.83952547 -0.8779622 0.6748051 0.2875963 0.3937513 0.6761233
row1 0.01870269 -0.6691405 1.6722286 0.9356700 -1.0217304 -0.9760716
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.2544318 -0.5673247 -0.1407340 -1.760455 -0.4583468 0.9322813 0.7151769
row1 -0.4150723 0.3633776 -0.6178048 0.364916 1.3172338 1.5308873 0.1510171
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -1.604984 0.04279042 -0.03582885 0.7792478 0.3677609 -1.661818 0.168573
[,8] [,9] [,10]
row2 0.3190955 0.2368049 0.1712534
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -1.472427 0.790143 -0.2214733 -1.961172 -0.6330993 -0.3123395 0.1415598
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.8108181 1.055995 -0.03139624 -0.4148231 0.9763051 -1.237623 1.407456
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.6836985 -0.1583986 1.513415 -1.240234 -1.087758 -0.3214731
>
>
> 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: 0x5c1b4f88fed0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25ace173c07092"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25ace17809445a"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25ace1715aa8fe"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25ace12fa25fd8"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25ace16734e0ab"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25ace1335907b"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25ace158b70b65"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25ace15de508c7"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25ace17dd9e4b2"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25ace174d0aeef"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25ace11085840f"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25ace13bb91990"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25ace1361c43f8"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25ace17d1f5b03"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM25ace15d4c1c5"
>
>
> ### 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: 0x5c1b500664a0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5c1b500664a0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5c1b500664a0>
> rowMedians(tmp)
[1] 0.2852005143 -0.0029502259 -0.3370316551 -0.2427823617 -0.4234369390
[6] 0.3384143548 -0.1824350568 -0.3129734956 -0.1445514051 0.3808381142
[11] -0.0374168996 -0.5133079111 -0.3677388447 0.1238996435 0.4006650082
[16] 0.0073919122 0.2609308383 0.3730799261 0.3023711781 0.3060486982
[21] 0.2913359475 0.2635416345 -0.6880437989 0.0425291063 -0.2536625062
[26] 0.2813443672 -0.8019859138 0.3442428836 0.5081006384 0.2803596026
[31] 0.3627238463 -0.3623927876 0.4578316396 0.1652923869 -0.1902249869
[36] -0.4435846915 0.6834172321 -0.2687280387 -0.1013288348 0.0078555107
[41] -0.3919586456 -0.2413305496 -0.0287748418 -0.0768717018 -0.0310342573
[46] 0.1369020059 0.2414804050 -0.0999779773 0.1932542367 0.3289809595
[51] 0.1726414571 -0.0677351245 0.0085023854 -0.6219615861 0.0616556065
[56] -0.4379086824 -0.3348295977 -0.1827715269 0.7526316766 -0.3224916844
[61] 0.2775822308 0.4069499356 -0.0288288181 0.4391779970 0.2067928899
[66] 0.2503363188 -0.2780710672 0.4903045151 0.4836547519 0.0346407910
[71] 0.0350030763 0.5279838627 0.0777179850 0.1206751035 -0.7365318594
[76] 0.0511828085 -0.2360886913 -0.1434631364 -0.0651667487 0.2958564416
[81] 0.4961077922 -0.3636478061 -0.2998814713 -0.0835405509 -0.5391395957
[86] -0.2554929275 -0.0165255106 0.5320816512 -0.1755772848 -0.3432083716
[91] 0.7437099334 0.1228141097 0.2103930457 0.1888588571 0.0461928974
[96] -0.3084684259 0.2865115468 -0.8680099405 -0.5649045385 -0.1636516472
[101] 0.2945559340 0.2352866316 -0.1421630479 0.0398865545 -0.3226892832
[106] 0.0679621045 -0.5454501230 0.0348826621 0.0635491025 -0.2771794131
[111] 0.0649983549 -0.5469364749 -0.1430553101 0.0008090085 -0.0439775262
[116] -0.1335611631 -0.2405283142 0.0033104130 0.5434647485 0.3199662803
[121] -0.1805633040 0.3683371136 0.3202909897 0.2915668971 -0.3268643097
[126] -0.4217095045 -0.2312425730 0.4465626672 0.2215369082 -0.8322167940
[131] -0.1570569991 0.1327944060 -0.3046825196 -0.1881744982 -0.0698707350
[136] 0.3156160628 0.1575336990 -0.4196383172 0.2592752827 -0.0593301589
[141] -0.1372254888 -0.2851799065 0.0556884235 0.4759249734 -0.1553218137
[146] 0.1085047391 -0.0815299965 -0.5949742694 -0.1405863446 0.1841502108
[151] 0.3014552544 0.0755499542 -0.4174068909 -0.1458158995 -0.1396903166
[156] -0.0421771277 0.0917627016 -0.0656973477 0.2180546027 -0.0726092987
[161] 0.5746965252 -0.0592965072 0.2145510737 0.2500494539 0.0489108091
[166] -0.4522560862 0.6058577997 -0.4124516867 0.0117093881 0.1812959111
[171] -0.0641487850 0.4997904834 0.2005630582 0.3130609032 -0.1466096391
[176] 0.1461081476 -0.0348053687 -0.0155700761 -0.2163304320 -0.3118590552
[181] 0.0359817160 -0.0627336970 0.1965496757 -0.6429786730 -0.5099860463
[186] -0.0631505982 0.4568774738 -0.2492361342 0.4033119951 -0.4828395791
[191] 0.3557682126 -0.1645252568 -0.2573028700 0.0565195162 0.0079715541
[196] 0.0588778292 0.1551274888 0.8331872629 0.2271159076 0.0438933390
[201] 0.4799293693 -0.0445415907 0.0950464030 0.1689603172 0.0519276202
[206] -0.0772396019 0.2719931544 -0.5142002460 0.3326131142 -0.5790716737
[211] 0.2414505939 0.3221800275 0.0211187201 0.0245265973 -0.0423885583
[216] -0.3007564767 -0.1976240026 0.3043944006 -0.2684341505 0.2970170861
[221] -0.5785665121 0.1577639381 -0.1326963966 0.0866245505 -0.1316108088
[226] -0.1857916030 -0.1355495966 -0.2192949900 0.5692259893 -0.2065438193
>
> proc.time()
user system elapsed
1.248 0.642 1.878
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: 0x55fb66ed8370>
> .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: 0x55fb66ed8370>
> .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: 0x55fb66ed8370>
> .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: 0x55fb66ed8370>
> 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: 0x55fb66ec01c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55fb66ec01c0>
> .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: 0x55fb66ec01c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55fb66ec01c0>
> .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: 0x55fb66ec01c0>
> 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: 0x55fb671a3120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55fb671a3120>
> .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: 0x55fb671a3120>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x55fb671a3120>
> .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: 0x55fb671a3120>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x55fb671a3120>
> .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: 0x55fb671a3120>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x55fb671a3120>
> .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: 0x55fb671a3120>
> 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: 0x55fb65ef3390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x55fb65ef3390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55fb65ef3390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55fb65ef3390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile25adab22d89a1a" "BufferedMatrixFile25adab4ee1e549"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile25adab22d89a1a" "BufferedMatrixFile25adab4ee1e549"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x55fb65dea3d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55fb65dea3d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x55fb65dea3d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x55fb65dea3d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x55fb65dea3d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x55fb65dea3d0>
> .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: 0x55fb6791ffa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x55fb6791ffa0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x55fb6791ffa0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x55fb6791ffa0>
> 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: 0x55fb660f7ff0>
> .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: 0x55fb660f7ff0>
> rm(P)
>
> proc.time()
user system elapsed
0.236 0.054 0.277
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.255 0.039 0.282