| Back to Build/check report for BioC 3.22: simplified long |
|
This page was generated on 2026-02-27 11:57 -0500 (Fri, 27 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" | 4891 |
| 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-26 21:40:34 -0500 (Thu, 26 Feb 2026) |
| EndedAt: 2026-02-26 21:40:58 -0500 (Thu, 26 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.250 0.045 0.284
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 26 21:40:49 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 26 21:40:49 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: 0x5a268d032370>
>
>
>
> 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 26 21:40:49 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 26 21:40:49 2026"
>
> ColMode(tmp2)
<pointer: 0x5a268d032370>
>
>
>
> ### 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,] 101.9371619 0.2206308 1.9591253 -0.40793327
[2,] -1.3147028 -0.2682187 -0.3870093 0.07249461
[3,] -0.5943154 1.5351841 -1.4738238 0.83272131
[4,] -1.1361505 -0.7847038 0.3988325 0.01757657
> 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,] 101.9371619 0.2206308 1.9591253 0.40793327
[2,] 1.3147028 0.2682187 0.3870093 0.07249461
[3,] 0.5943154 1.5351841 1.4738238 0.83272131
[4,] 1.1361505 0.7847038 0.3988325 0.01757657
> 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.0963935 0.4697136 1.3996876 0.6386965
[2,] 1.1466049 0.5178984 0.6221007 0.2692482
[3,] 0.7709185 1.2390254 1.2140114 0.9125356
[4,] 1.0659036 0.8858351 0.6315318 0.1325766
>
> 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,] 227.90110 29.91777 40.95600 31.79490
[2,] 37.78075 30.44720 31.60802 27.76498
[3,] 33.30350 38.92544 38.61394 34.95808
[4,] 36.79519 34.64305 31.71415 26.34334
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5a268e02e9b0>
> exp(tmp5)
<pointer: 0x5a268e02e9b0>
> log(tmp5,2)
<pointer: 0x5a268e02e9b0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 474.3463
> Min(tmp5)
[1] 52.51618
> mean(tmp5)
[1] 72.47069
> Sum(tmp5)
[1] 14494.14
> Var(tmp5)
[1] 889.7499
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 93.47705 68.49459 72.78805 70.35270 70.70382 67.89883 71.43928 69.49942
[9] 68.18162 71.87149
> rowSums(tmp5)
[1] 1869.541 1369.892 1455.761 1407.054 1414.076 1357.977 1428.786 1389.988
[9] 1363.632 1437.430
> rowVars(tmp5)
[1] 8107.60978 72.11878 84.00322 95.39525 59.90482 66.01444
[7] 86.57181 91.86617 45.94708 68.12312
> rowSd(tmp5)
[1] 90.042267 8.492277 9.165327 9.767049 7.739821 8.124927 9.304398
[8] 9.584684 6.778428 8.253673
> rowMax(tmp5)
[1] 474.34627 83.49035 85.79484 88.85856 85.55781 84.24084 92.76848
[8] 85.80235 76.38501 84.01866
> rowMin(tmp5)
[1] 59.12607 56.05066 56.11953 54.83022 60.80897 52.51618 54.77045 55.12992
[9] 55.87291 54.38365
>
> colMeans(tmp5)
[1] 108.82265 68.63843 74.06253 67.38502 70.13407 73.37003 71.85297
[8] 69.10509 67.28814 72.62550 69.24189 71.62223 71.41816 70.02840
[15] 66.64459 74.13175 70.30518 73.40627 67.54468 71.78612
> colSums(tmp5)
[1] 1088.2265 686.3843 740.6253 673.8502 701.3407 733.7003 718.5297
[8] 691.0509 672.8814 726.2550 692.4189 716.2223 714.1816 700.2840
[15] 666.4459 741.3175 703.0518 734.0627 675.4468 717.8612
> colVars(tmp5)
[1] 16548.38746 59.82952 72.06162 84.72015 57.41665 56.26312
[7] 123.10575 61.73326 97.02874 90.33795 40.55126 86.99907
[13] 91.79458 74.53602 120.72812 85.70860 63.25854 20.66752
[19] 98.05760 79.47347
> colSd(tmp5)
[1] 128.640536 7.734955 8.488912 9.204355 7.577377 7.500875
[7] 11.095303 7.857052 9.850317 9.504628 6.367987 9.327329
[13] 9.580949 8.633424 10.987635 9.257894 7.953524 4.546155
[19] 9.902404 8.914790
> colMax(tmp5)
[1] 474.34627 81.01820 86.69159 83.31164 82.23121 85.55781 82.68176
[8] 85.32931 82.59351 88.85856 78.95892 85.79484 86.02474 83.46338
[15] 81.35031 92.76848 84.01866 80.89236 85.80235 84.15689
> colMin(tmp5)
[1] 54.77045 55.12992 60.41498 54.83022 59.97944 60.37704 55.39309 60.30562
[9] 56.35000 55.70075 60.63791 55.49537 56.62019 58.48689 52.51618 60.95093
[17] 61.02489 64.84213 56.05066 58.72232
>
>
> ### 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] 93.47705 68.49459 72.78805 70.35270 70.70382 67.89883 NA 69.49942
[9] 68.18162 71.87149
> rowSums(tmp5)
[1] 1869.541 1369.892 1455.761 1407.054 1414.076 1357.977 NA 1389.988
[9] 1363.632 1437.430
> rowVars(tmp5)
[1] 8107.60978 72.11878 84.00322 95.39525 59.90482 66.01444
[7] 90.55594 91.86617 45.94708 68.12312
> rowSd(tmp5)
[1] 90.042267 8.492277 9.165327 9.767049 7.739821 8.124927 9.516088
[8] 9.584684 6.778428 8.253673
> rowMax(tmp5)
[1] 474.34627 83.49035 85.79484 88.85856 85.55781 84.24084 NA
[8] 85.80235 76.38501 84.01866
> rowMin(tmp5)
[1] 59.12607 56.05066 56.11953 54.83022 60.80897 52.51618 NA 55.12992
[9] 55.87291 54.38365
>
> colMeans(tmp5)
[1] 108.82265 68.63843 74.06253 67.38502 70.13407 73.37003 71.85297
[8] 69.10509 67.28814 NA 69.24189 71.62223 71.41816 70.02840
[15] 66.64459 74.13175 70.30518 73.40627 67.54468 71.78612
> colSums(tmp5)
[1] 1088.2265 686.3843 740.6253 673.8502 701.3407 733.7003 718.5297
[8] 691.0509 672.8814 NA 692.4189 716.2223 714.1816 700.2840
[15] 666.4459 741.3175 703.0518 734.0627 675.4468 717.8612
> colVars(tmp5)
[1] 16548.38746 59.82952 72.06162 84.72015 57.41665 56.26312
[7] 123.10575 61.73326 97.02874 NA 40.55126 86.99907
[13] 91.79458 74.53602 120.72812 85.70860 63.25854 20.66752
[19] 98.05760 79.47347
> colSd(tmp5)
[1] 128.640536 7.734955 8.488912 9.204355 7.577377 7.500875
[7] 11.095303 7.857052 9.850317 NA 6.367987 9.327329
[13] 9.580949 8.633424 10.987635 9.257894 7.953524 4.546155
[19] 9.902404 8.914790
> colMax(tmp5)
[1] 474.34627 81.01820 86.69159 83.31164 82.23121 85.55781 82.68176
[8] 85.32931 82.59351 NA 78.95892 85.79484 86.02474 83.46338
[15] 81.35031 92.76848 84.01866 80.89236 85.80235 84.15689
> colMin(tmp5)
[1] 54.77045 55.12992 60.41498 54.83022 59.97944 60.37704 55.39309 60.30562
[9] 56.35000 NA 60.63791 55.49537 56.62019 58.48689 52.51618 60.95093
[17] 61.02489 64.84213 56.05066 58.72232
>
> Max(tmp5,na.rm=TRUE)
[1] 474.3463
> Min(tmp5,na.rm=TRUE)
[1] 52.51618
> mean(tmp5,na.rm=TRUE)
[1] 72.45699
> Sum(tmp5,na.rm=TRUE)
[1] 14418.94
> Var(tmp5,na.rm=TRUE)
[1] 894.2058
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 93.47705 68.49459 72.78805 70.35270 70.70382 67.89883 71.24155 69.49942
[9] 68.18162 71.87149
> rowSums(tmp5,na.rm=TRUE)
[1] 1869.541 1369.892 1455.761 1407.054 1414.076 1357.977 1353.589 1389.988
[9] 1363.632 1437.430
> rowVars(tmp5,na.rm=TRUE)
[1] 8107.60978 72.11878 84.00322 95.39525 59.90482 66.01444
[7] 90.55594 91.86617 45.94708 68.12312
> rowSd(tmp5,na.rm=TRUE)
[1] 90.042267 8.492277 9.165327 9.767049 7.739821 8.124927 9.516088
[8] 9.584684 6.778428 8.253673
> rowMax(tmp5,na.rm=TRUE)
[1] 474.34627 83.49035 85.79484 88.85856 85.55781 84.24084 92.76848
[8] 85.80235 76.38501 84.01866
> rowMin(tmp5,na.rm=TRUE)
[1] 59.12607 56.05066 56.11953 54.83022 60.80897 52.51618 54.77045 55.12992
[9] 55.87291 54.38365
>
> colMeans(tmp5,na.rm=TRUE)
[1] 108.82265 68.63843 74.06253 67.38502 70.13407 73.37003 71.85297
[8] 69.10509 67.28814 72.33986 69.24189 71.62223 71.41816 70.02840
[15] 66.64459 74.13175 70.30518 73.40627 67.54468 71.78612
> colSums(tmp5,na.rm=TRUE)
[1] 1088.2265 686.3843 740.6253 673.8502 701.3407 733.7003 718.5297
[8] 691.0509 672.8814 651.0588 692.4189 716.2223 714.1816 700.2840
[15] 666.4459 741.3175 703.0518 734.0627 675.4468 717.8612
> colVars(tmp5,na.rm=TRUE)
[1] 16548.38746 59.82952 72.06162 84.72015 57.41665 56.26312
[7] 123.10575 61.73326 97.02874 100.71232 40.55126 86.99907
[13] 91.79458 74.53602 120.72812 85.70860 63.25854 20.66752
[19] 98.05760 79.47347
> colSd(tmp5,na.rm=TRUE)
[1] 128.640536 7.734955 8.488912 9.204355 7.577377 7.500875
[7] 11.095303 7.857052 9.850317 10.035553 6.367987 9.327329
[13] 9.580949 8.633424 10.987635 9.257894 7.953524 4.546155
[19] 9.902404 8.914790
> colMax(tmp5,na.rm=TRUE)
[1] 474.34627 81.01820 86.69159 83.31164 82.23121 85.55781 82.68176
[8] 85.32931 82.59351 88.85856 78.95892 85.79484 86.02474 83.46338
[15] 81.35031 92.76848 84.01866 80.89236 85.80235 84.15689
> colMin(tmp5,na.rm=TRUE)
[1] 54.77045 55.12992 60.41498 54.83022 59.97944 60.37704 55.39309 60.30562
[9] 56.35000 55.70075 60.63791 55.49537 56.62019 58.48689 52.51618 60.95093
[17] 61.02489 64.84213 56.05066 58.72232
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 93.47705 68.49459 72.78805 70.35270 70.70382 67.89883 NaN 69.49942
[9] 68.18162 71.87149
> rowSums(tmp5,na.rm=TRUE)
[1] 1869.541 1369.892 1455.761 1407.054 1414.076 1357.977 0.000 1389.988
[9] 1363.632 1437.430
> rowVars(tmp5,na.rm=TRUE)
[1] 8107.60978 72.11878 84.00322 95.39525 59.90482 66.01444
[7] NA 91.86617 45.94708 68.12312
> rowSd(tmp5,na.rm=TRUE)
[1] 90.042267 8.492277 9.165327 9.767049 7.739821 8.124927 NA
[8] 9.584684 6.778428 8.253673
> rowMax(tmp5,na.rm=TRUE)
[1] 474.34627 83.49035 85.79484 88.85856 85.55781 84.24084 NA
[8] 85.80235 76.38501 84.01866
> rowMin(tmp5,na.rm=TRUE)
[1] 59.12607 56.05066 56.11953 54.83022 60.80897 52.51618 NA 55.12992
[9] 55.87291 54.38365
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 114.82845 68.43396 72.65931 67.77818 69.41396 73.56798 70.87905
[8] 69.77160 67.37923 NaN 68.59346 72.24463 73.06238 69.61434
[15] 65.25525 72.06100 70.78656 73.47669 67.83299 71.72686
> colSums(tmp5,na.rm=TRUE)
[1] 1033.4561 615.9057 653.9337 610.0036 624.7257 662.1118 637.9114
[8] 627.9444 606.4130 0.0000 617.3411 650.2016 657.5614 626.5290
[15] 587.2972 648.5490 637.0790 661.2902 610.4969 645.5417
> colVars(tmp5,na.rm=TRUE)
[1] 18211.15244 66.83787 58.91752 93.57119 58.75997 62.85521
[7] 127.82303 64.45238 109.06398 NA 40.88996 93.51590
[13] 72.85505 81.92424 114.10349 48.18218 68.55890 23.19519
[19] 109.37969 89.36815
> colSd(tmp5,na.rm=TRUE)
[1] 134.948703 8.175443 7.675775 9.673220 7.665505 7.928128
[7] 11.305885 8.028224 10.443370 NA 6.394526 9.670362
[13] 8.535517 9.051201 10.681923 6.941338 8.280030 4.816138
[19] 10.458475 9.453473
> colMax(tmp5,na.rm=TRUE)
[1] 474.34627 81.01820 85.24455 83.31164 82.23121 85.55781 82.68176
[8] 85.32931 82.59351 -Inf 78.95892 85.79484 86.02474 83.46338
[15] 81.35031 80.59971 84.01866 80.89236 85.80235 84.15689
> colMin(tmp5,na.rm=TRUE)
[1] 59.60020 55.12992 60.41498 54.83022 59.97944 60.37704 55.39309 60.30562
[9] 56.35000 Inf 60.63791 55.49537 60.00665 58.48689 52.51618 60.95093
[17] 61.02489 64.84213 56.05066 58.72232
>
>
>
>
> 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] 152.6611 209.7323 183.5281 299.8662 277.0544 180.2721 285.4504 161.9192
[9] 220.4406 220.2379
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 152.6611 209.7323 183.5281 299.8662 277.0544 180.2721 285.4504 161.9192
[9] 220.4406 220.2379
>
>
>
> 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.563194e-13 -2.842171e-14 1.705303e-13 -1.989520e-13 -1.705303e-13
[6] -5.684342e-14 0.000000e+00 7.105427e-15 -2.842171e-14 1.705303e-13
[11] 0.000000e+00 3.410605e-13 -1.136868e-13 1.136868e-13 -8.526513e-14
[16] -1.136868e-13 2.842171e-14 1.421085e-14 2.842171e-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)
+ }
4 12
6 9
5 4
8 13
7 1
3 3
1 4
3 12
10 12
6 18
5 20
8 10
6 20
10 18
1 12
9 13
9 3
7 7
10 12
5 17
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] 3.008549
> Min(tmp)
[1] -3.171445
> mean(tmp)
[1] -0.1020068
> Sum(tmp)
[1] -10.20068
> Var(tmp)
[1] 1.150394
>
> rowMeans(tmp)
[1] -0.1020068
> rowSums(tmp)
[1] -10.20068
> rowVars(tmp)
[1] 1.150394
> rowSd(tmp)
[1] 1.072564
> rowMax(tmp)
[1] 3.008549
> rowMin(tmp)
[1] -3.171445
>
> colMeans(tmp)
[1] -0.18882653 -0.52100389 1.15634958 1.81886216 0.10738884 0.63768234
[7] -0.01292573 1.65401796 0.12858196 -1.19398559 0.42255651 -3.17144501
[13] 1.20518836 -1.68068234 -1.23340587 -1.04979604 1.15893187 -1.20730038
[19] -0.50392244 -0.67753470 -1.22380710 1.25811784 0.22731909 0.20284259
[25] -1.59269249 -0.34501761 -2.29897876 -0.74167529 -2.23770598 1.60005762
[31] -0.37242050 -0.56354471 -0.87674027 -0.08598366 0.84028399 -0.22859079
[37] -0.39936967 -0.36085071 0.09081858 -1.44582711 -0.85641580 0.22143609
[43] 0.83775334 -0.44947694 0.37927248 0.01908563 -0.41276113 0.41689446
[49] -0.74361679 3.00854852 -0.52322234 -0.51218456 0.58536844 -0.53691077
[55] 1.33299134 -0.72554729 1.87952555 0.30218733 -0.37063257 -0.41018530
[61] 1.25631575 -0.76621240 -0.69963390 -1.03639104 -1.16147155 1.17855410
[67] -0.28558958 1.27952144 -1.49332320 -0.89182271 -1.00483506 0.61058840
[73] 0.05128699 -1.31689099 -1.29133806 -0.75096431 0.90152514 -1.76894470
[79] 0.08416348 -1.06896720 0.65947863 0.24756724 0.28756035 -0.96865538
[85] -0.98147653 0.45103093 2.06082318 -1.95696114 0.72000807 0.78553702
[91] 1.25517900 0.76135422 0.69007335 1.88897357 -0.93250546 0.26882244
[97] 0.40749422 -0.49058254 0.89910021 0.18385494
> colSums(tmp)
[1] -0.18882653 -0.52100389 1.15634958 1.81886216 0.10738884 0.63768234
[7] -0.01292573 1.65401796 0.12858196 -1.19398559 0.42255651 -3.17144501
[13] 1.20518836 -1.68068234 -1.23340587 -1.04979604 1.15893187 -1.20730038
[19] -0.50392244 -0.67753470 -1.22380710 1.25811784 0.22731909 0.20284259
[25] -1.59269249 -0.34501761 -2.29897876 -0.74167529 -2.23770598 1.60005762
[31] -0.37242050 -0.56354471 -0.87674027 -0.08598366 0.84028399 -0.22859079
[37] -0.39936967 -0.36085071 0.09081858 -1.44582711 -0.85641580 0.22143609
[43] 0.83775334 -0.44947694 0.37927248 0.01908563 -0.41276113 0.41689446
[49] -0.74361679 3.00854852 -0.52322234 -0.51218456 0.58536844 -0.53691077
[55] 1.33299134 -0.72554729 1.87952555 0.30218733 -0.37063257 -0.41018530
[61] 1.25631575 -0.76621240 -0.69963390 -1.03639104 -1.16147155 1.17855410
[67] -0.28558958 1.27952144 -1.49332320 -0.89182271 -1.00483506 0.61058840
[73] 0.05128699 -1.31689099 -1.29133806 -0.75096431 0.90152514 -1.76894470
[79] 0.08416348 -1.06896720 0.65947863 0.24756724 0.28756035 -0.96865538
[85] -0.98147653 0.45103093 2.06082318 -1.95696114 0.72000807 0.78553702
[91] 1.25517900 0.76135422 0.69007335 1.88897357 -0.93250546 0.26882244
[97] 0.40749422 -0.49058254 0.89910021 0.18385494
> 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.18882653 -0.52100389 1.15634958 1.81886216 0.10738884 0.63768234
[7] -0.01292573 1.65401796 0.12858196 -1.19398559 0.42255651 -3.17144501
[13] 1.20518836 -1.68068234 -1.23340587 -1.04979604 1.15893187 -1.20730038
[19] -0.50392244 -0.67753470 -1.22380710 1.25811784 0.22731909 0.20284259
[25] -1.59269249 -0.34501761 -2.29897876 -0.74167529 -2.23770598 1.60005762
[31] -0.37242050 -0.56354471 -0.87674027 -0.08598366 0.84028399 -0.22859079
[37] -0.39936967 -0.36085071 0.09081858 -1.44582711 -0.85641580 0.22143609
[43] 0.83775334 -0.44947694 0.37927248 0.01908563 -0.41276113 0.41689446
[49] -0.74361679 3.00854852 -0.52322234 -0.51218456 0.58536844 -0.53691077
[55] 1.33299134 -0.72554729 1.87952555 0.30218733 -0.37063257 -0.41018530
[61] 1.25631575 -0.76621240 -0.69963390 -1.03639104 -1.16147155 1.17855410
[67] -0.28558958 1.27952144 -1.49332320 -0.89182271 -1.00483506 0.61058840
[73] 0.05128699 -1.31689099 -1.29133806 -0.75096431 0.90152514 -1.76894470
[79] 0.08416348 -1.06896720 0.65947863 0.24756724 0.28756035 -0.96865538
[85] -0.98147653 0.45103093 2.06082318 -1.95696114 0.72000807 0.78553702
[91] 1.25517900 0.76135422 0.69007335 1.88897357 -0.93250546 0.26882244
[97] 0.40749422 -0.49058254 0.89910021 0.18385494
> colMin(tmp)
[1] -0.18882653 -0.52100389 1.15634958 1.81886216 0.10738884 0.63768234
[7] -0.01292573 1.65401796 0.12858196 -1.19398559 0.42255651 -3.17144501
[13] 1.20518836 -1.68068234 -1.23340587 -1.04979604 1.15893187 -1.20730038
[19] -0.50392244 -0.67753470 -1.22380710 1.25811784 0.22731909 0.20284259
[25] -1.59269249 -0.34501761 -2.29897876 -0.74167529 -2.23770598 1.60005762
[31] -0.37242050 -0.56354471 -0.87674027 -0.08598366 0.84028399 -0.22859079
[37] -0.39936967 -0.36085071 0.09081858 -1.44582711 -0.85641580 0.22143609
[43] 0.83775334 -0.44947694 0.37927248 0.01908563 -0.41276113 0.41689446
[49] -0.74361679 3.00854852 -0.52322234 -0.51218456 0.58536844 -0.53691077
[55] 1.33299134 -0.72554729 1.87952555 0.30218733 -0.37063257 -0.41018530
[61] 1.25631575 -0.76621240 -0.69963390 -1.03639104 -1.16147155 1.17855410
[67] -0.28558958 1.27952144 -1.49332320 -0.89182271 -1.00483506 0.61058840
[73] 0.05128699 -1.31689099 -1.29133806 -0.75096431 0.90152514 -1.76894470
[79] 0.08416348 -1.06896720 0.65947863 0.24756724 0.28756035 -0.96865538
[85] -0.98147653 0.45103093 2.06082318 -1.95696114 0.72000807 0.78553702
[91] 1.25517900 0.76135422 0.69007335 1.88897357 -0.93250546 0.26882244
[97] 0.40749422 -0.49058254 0.89910021 0.18385494
> colMedians(tmp)
[1] -0.18882653 -0.52100389 1.15634958 1.81886216 0.10738884 0.63768234
[7] -0.01292573 1.65401796 0.12858196 -1.19398559 0.42255651 -3.17144501
[13] 1.20518836 -1.68068234 -1.23340587 -1.04979604 1.15893187 -1.20730038
[19] -0.50392244 -0.67753470 -1.22380710 1.25811784 0.22731909 0.20284259
[25] -1.59269249 -0.34501761 -2.29897876 -0.74167529 -2.23770598 1.60005762
[31] -0.37242050 -0.56354471 -0.87674027 -0.08598366 0.84028399 -0.22859079
[37] -0.39936967 -0.36085071 0.09081858 -1.44582711 -0.85641580 0.22143609
[43] 0.83775334 -0.44947694 0.37927248 0.01908563 -0.41276113 0.41689446
[49] -0.74361679 3.00854852 -0.52322234 -0.51218456 0.58536844 -0.53691077
[55] 1.33299134 -0.72554729 1.87952555 0.30218733 -0.37063257 -0.41018530
[61] 1.25631575 -0.76621240 -0.69963390 -1.03639104 -1.16147155 1.17855410
[67] -0.28558958 1.27952144 -1.49332320 -0.89182271 -1.00483506 0.61058840
[73] 0.05128699 -1.31689099 -1.29133806 -0.75096431 0.90152514 -1.76894470
[79] 0.08416348 -1.06896720 0.65947863 0.24756724 0.28756035 -0.96865538
[85] -0.98147653 0.45103093 2.06082318 -1.95696114 0.72000807 0.78553702
[91] 1.25517900 0.76135422 0.69007335 1.88897357 -0.93250546 0.26882244
[97] 0.40749422 -0.49058254 0.89910021 0.18385494
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.1888265 -0.5210039 1.15635 1.818862 0.1073888 0.6376823 -0.01292573
[2,] -0.1888265 -0.5210039 1.15635 1.818862 0.1073888 0.6376823 -0.01292573
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 1.654018 0.128582 -1.193986 0.4225565 -3.171445 1.205188 -1.680682
[2,] 1.654018 0.128582 -1.193986 0.4225565 -3.171445 1.205188 -1.680682
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -1.233406 -1.049796 1.158932 -1.2073 -0.5039224 -0.6775347 -1.223807
[2,] -1.233406 -1.049796 1.158932 -1.2073 -0.5039224 -0.6775347 -1.223807
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 1.258118 0.2273191 0.2028426 -1.592692 -0.3450176 -2.298979 -0.7416753
[2,] 1.258118 0.2273191 0.2028426 -1.592692 -0.3450176 -2.298979 -0.7416753
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -2.237706 1.600058 -0.3724205 -0.5635447 -0.8767403 -0.08598366 0.840284
[2,] -2.237706 1.600058 -0.3724205 -0.5635447 -0.8767403 -0.08598366 0.840284
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.2285908 -0.3993697 -0.3608507 0.09081858 -1.445827 -0.8564158 0.2214361
[2,] -0.2285908 -0.3993697 -0.3608507 0.09081858 -1.445827 -0.8564158 0.2214361
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.8377533 -0.4494769 0.3792725 0.01908563 -0.4127611 0.4168945 -0.7436168
[2,] 0.8377533 -0.4494769 0.3792725 0.01908563 -0.4127611 0.4168945 -0.7436168
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 3.008549 -0.5232223 -0.5121846 0.5853684 -0.5369108 1.332991 -0.7255473
[2,] 3.008549 -0.5232223 -0.5121846 0.5853684 -0.5369108 1.332991 -0.7255473
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 1.879526 0.3021873 -0.3706326 -0.4101853 1.256316 -0.7662124 -0.6996339
[2,] 1.879526 0.3021873 -0.3706326 -0.4101853 1.256316 -0.7662124 -0.6996339
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -1.036391 -1.161472 1.178554 -0.2855896 1.279521 -1.493323 -0.8918227
[2,] -1.036391 -1.161472 1.178554 -0.2855896 1.279521 -1.493323 -0.8918227
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -1.004835 0.6105884 0.05128699 -1.316891 -1.291338 -0.7509643 0.9015251
[2,] -1.004835 0.6105884 0.05128699 -1.316891 -1.291338 -0.7509643 0.9015251
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -1.768945 0.08416348 -1.068967 0.6594786 0.2475672 0.2875603 -0.9686554
[2,] -1.768945 0.08416348 -1.068967 0.6594786 0.2475672 0.2875603 -0.9686554
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.9814765 0.4510309 2.060823 -1.956961 0.7200081 0.785537 1.255179
[2,] -0.9814765 0.4510309 2.060823 -1.956961 0.7200081 0.785537 1.255179
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 0.7613542 0.6900733 1.888974 -0.9325055 0.2688224 0.4074942 -0.4905825
[2,] 0.7613542 0.6900733 1.888974 -0.9325055 0.2688224 0.4074942 -0.4905825
[,99] [,100]
[1,] 0.8991002 0.1838549
[2,] 0.8991002 0.1838549
>
>
> Max(tmp2)
[1] 2.824826
> Min(tmp2)
[1] -2.984491
> mean(tmp2)
[1] -0.07184805
> Sum(tmp2)
[1] -7.184805
> Var(tmp2)
[1] 0.9793945
>
> rowMeans(tmp2)
[1] -0.97034499 -0.91410801 0.23920256 -0.30987889 -0.19018002 0.45006970
[7] 1.79668241 1.10308546 -0.88384851 -0.93165088 0.99012007 0.60738162
[13] 1.02762174 0.56702676 0.80928645 -0.31269638 0.30718904 0.69529737
[19] 0.51992577 1.11968874 -0.03481807 -1.49875405 2.82482577 0.48224668
[25] 0.41829380 -0.85521910 -0.63088783 0.20266006 -0.66286844 1.22976787
[31] 0.10460259 0.54735451 -1.74546309 -1.18932027 0.61428049 -1.93557979
[37] -0.09249633 -0.13759553 -0.69187089 -1.16629056 -0.80046962 0.53925508
[43] 0.13485288 0.60570615 0.68553761 -1.58119871 1.43896301 -1.03751463
[49] 0.84206532 0.47248860 -0.11015164 -1.07359837 0.55202941 0.54380880
[55] -2.98449130 -0.68703265 -0.13409338 -0.31199079 0.42080560 -0.21802778
[61] 0.42518939 0.07466516 1.07079423 -0.13562278 0.62324771 -0.90019569
[67] 1.09827002 -1.16280955 -1.58238784 -1.28478203 0.19590598 -0.21531916
[73] -1.55668264 -0.56084900 -1.00219686 -0.75658241 -2.50318931 -0.48864391
[79] 0.55344274 -0.06404670 0.76643851 0.04397880 0.23852595 1.60388674
[85] -0.80153268 0.74323320 -0.71637217 2.29059531 -1.27449727 -0.17652241
[91] -1.12211927 -0.23839850 1.89903737 0.60432025 -0.25304434 -0.76143195
[97] 0.14913084 0.44729037 -0.54258055 -0.71263167
> rowSums(tmp2)
[1] -0.97034499 -0.91410801 0.23920256 -0.30987889 -0.19018002 0.45006970
[7] 1.79668241 1.10308546 -0.88384851 -0.93165088 0.99012007 0.60738162
[13] 1.02762174 0.56702676 0.80928645 -0.31269638 0.30718904 0.69529737
[19] 0.51992577 1.11968874 -0.03481807 -1.49875405 2.82482577 0.48224668
[25] 0.41829380 -0.85521910 -0.63088783 0.20266006 -0.66286844 1.22976787
[31] 0.10460259 0.54735451 -1.74546309 -1.18932027 0.61428049 -1.93557979
[37] -0.09249633 -0.13759553 -0.69187089 -1.16629056 -0.80046962 0.53925508
[43] 0.13485288 0.60570615 0.68553761 -1.58119871 1.43896301 -1.03751463
[49] 0.84206532 0.47248860 -0.11015164 -1.07359837 0.55202941 0.54380880
[55] -2.98449130 -0.68703265 -0.13409338 -0.31199079 0.42080560 -0.21802778
[61] 0.42518939 0.07466516 1.07079423 -0.13562278 0.62324771 -0.90019569
[67] 1.09827002 -1.16280955 -1.58238784 -1.28478203 0.19590598 -0.21531916
[73] -1.55668264 -0.56084900 -1.00219686 -0.75658241 -2.50318931 -0.48864391
[79] 0.55344274 -0.06404670 0.76643851 0.04397880 0.23852595 1.60388674
[85] -0.80153268 0.74323320 -0.71637217 2.29059531 -1.27449727 -0.17652241
[91] -1.12211927 -0.23839850 1.89903737 0.60432025 -0.25304434 -0.76143195
[97] 0.14913084 0.44729037 -0.54258055 -0.71263167
> 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.97034499 -0.91410801 0.23920256 -0.30987889 -0.19018002 0.45006970
[7] 1.79668241 1.10308546 -0.88384851 -0.93165088 0.99012007 0.60738162
[13] 1.02762174 0.56702676 0.80928645 -0.31269638 0.30718904 0.69529737
[19] 0.51992577 1.11968874 -0.03481807 -1.49875405 2.82482577 0.48224668
[25] 0.41829380 -0.85521910 -0.63088783 0.20266006 -0.66286844 1.22976787
[31] 0.10460259 0.54735451 -1.74546309 -1.18932027 0.61428049 -1.93557979
[37] -0.09249633 -0.13759553 -0.69187089 -1.16629056 -0.80046962 0.53925508
[43] 0.13485288 0.60570615 0.68553761 -1.58119871 1.43896301 -1.03751463
[49] 0.84206532 0.47248860 -0.11015164 -1.07359837 0.55202941 0.54380880
[55] -2.98449130 -0.68703265 -0.13409338 -0.31199079 0.42080560 -0.21802778
[61] 0.42518939 0.07466516 1.07079423 -0.13562278 0.62324771 -0.90019569
[67] 1.09827002 -1.16280955 -1.58238784 -1.28478203 0.19590598 -0.21531916
[73] -1.55668264 -0.56084900 -1.00219686 -0.75658241 -2.50318931 -0.48864391
[79] 0.55344274 -0.06404670 0.76643851 0.04397880 0.23852595 1.60388674
[85] -0.80153268 0.74323320 -0.71637217 2.29059531 -1.27449727 -0.17652241
[91] -1.12211927 -0.23839850 1.89903737 0.60432025 -0.25304434 -0.76143195
[97] 0.14913084 0.44729037 -0.54258055 -0.71263167
> rowMin(tmp2)
[1] -0.97034499 -0.91410801 0.23920256 -0.30987889 -0.19018002 0.45006970
[7] 1.79668241 1.10308546 -0.88384851 -0.93165088 0.99012007 0.60738162
[13] 1.02762174 0.56702676 0.80928645 -0.31269638 0.30718904 0.69529737
[19] 0.51992577 1.11968874 -0.03481807 -1.49875405 2.82482577 0.48224668
[25] 0.41829380 -0.85521910 -0.63088783 0.20266006 -0.66286844 1.22976787
[31] 0.10460259 0.54735451 -1.74546309 -1.18932027 0.61428049 -1.93557979
[37] -0.09249633 -0.13759553 -0.69187089 -1.16629056 -0.80046962 0.53925508
[43] 0.13485288 0.60570615 0.68553761 -1.58119871 1.43896301 -1.03751463
[49] 0.84206532 0.47248860 -0.11015164 -1.07359837 0.55202941 0.54380880
[55] -2.98449130 -0.68703265 -0.13409338 -0.31199079 0.42080560 -0.21802778
[61] 0.42518939 0.07466516 1.07079423 -0.13562278 0.62324771 -0.90019569
[67] 1.09827002 -1.16280955 -1.58238784 -1.28478203 0.19590598 -0.21531916
[73] -1.55668264 -0.56084900 -1.00219686 -0.75658241 -2.50318931 -0.48864391
[79] 0.55344274 -0.06404670 0.76643851 0.04397880 0.23852595 1.60388674
[85] -0.80153268 0.74323320 -0.71637217 2.29059531 -1.27449727 -0.17652241
[91] -1.12211927 -0.23839850 1.89903737 0.60432025 -0.25304434 -0.76143195
[97] 0.14913084 0.44729037 -0.54258055 -0.71263167
>
> colMeans(tmp2)
[1] -0.07184805
> colSums(tmp2)
[1] -7.184805
> colVars(tmp2)
[1] 0.9793945
> colSd(tmp2)
[1] 0.9896436
> colMax(tmp2)
[1] 2.824826
> colMin(tmp2)
[1] -2.984491
> colMedians(tmp2)
[1] -0.07827151
> colRanges(tmp2)
[,1]
[1,] -2.984491
[2,] 2.824826
>
> 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.940549 -1.445942 -3.258551 -2.145000 -2.536108 3.643116 4.233984
[8] 1.254599 -5.341696 -2.065987
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.3639408
[2,] -0.6057745
[3,] 0.3077348
[4,] 0.8283032
[5,] 1.8206347
>
> rowApply(tmp,sum)
[1] -1.1562270 -4.0553722 0.4849607 1.8286026 1.9093702 -4.1132969
[7] 2.5730026 -0.2607426 -1.3777539 -1.5535798
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 9 10 5 1 10 1 8 9 5 3
[2,] 7 6 4 7 2 4 7 2 1 10
[3,] 2 8 2 5 6 2 6 6 6 1
[4,] 5 9 9 4 4 6 4 5 2 4
[5,] 1 5 3 9 9 3 2 7 10 6
[6,] 6 1 8 10 7 7 9 3 9 7
[7,] 3 7 10 2 3 10 10 8 8 9
[8,] 10 3 6 6 8 8 3 10 3 2
[9,] 4 2 7 3 1 9 1 4 4 5
[10,] 8 4 1 8 5 5 5 1 7 8
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 2.4065393 -0.4412686 1.6687681 0.6355837 -0.4314052 -1.4551293
[7] 2.0241381 0.4247990 1.1623883 -0.5367511 1.7034169 -0.3310837
[13] 3.0335902 0.2471617 1.4812543 0.3706850 -0.3043717 4.2832082
[19] 0.6065843 -3.8971660
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.6484752
[2,] 0.4830189
[3,] 0.8787420
[4,] 1.0754987
[5,] 1.6177548
>
> rowApply(tmp,sum)
[1] -1.8582085 7.3018258 -3.0565384 9.6948916 0.5689708
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 18 14 3 10 20
[2,] 5 15 1 16 16
[3,] 10 11 15 15 3
[4,] 8 9 8 19 8
[5,] 3 2 6 11 19
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1.0754987 -0.7193789 -0.2417274 -0.5495143 -0.8323423 -1.19441684
[2,] 0.8787420 0.9137613 0.5092023 0.3277349 -0.6704480 -0.08667748
[3,] -1.6484752 -2.4828764 0.5903102 -0.6037224 -0.7686118 0.18556375
[4,] 0.4830189 1.4340377 1.3872810 1.6881650 0.7230496 0.11657287
[5,] 1.6177548 0.4131877 -0.5762981 -0.2270795 1.1169472 -0.47617159
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.26296373 -0.70533143 -0.6323496 0.03126010 -0.1135852 -0.1620981
[2,] 0.20558340 1.14788068 -1.6716683 0.18495425 1.2873017 -0.2344583
[3,] -0.05302361 0.03929019 1.1598357 -0.06586183 2.2499113 -0.3654252
[4,] 1.47627546 1.33882245 2.2497269 -0.88366980 -1.3677026 -0.3473745
[5,] 0.13233909 -1.39586293 0.0568436 0.19656619 -0.3525083 0.7782724
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.44467599 0.5855732637 -0.3516604 -1.40959005 1.95986159 1.19917734
[2,] 1.11984039 -0.0007711232 0.3990237 1.18629908 0.80744078 1.01243398
[3,] 0.57004183 -0.6968420659 0.8375182 -0.92656581 -1.76680053 0.93970571
[4,] 0.09793192 0.0844951062 1.0362046 1.57702524 -1.29111271 1.10340985
[5,] 0.80110003 0.2747064946 -0.4398319 -0.05648341 -0.01376081 0.02848133
[,19] [,20]
[1,] 0.2594249 -0.7646496
[2,] 0.5615668 -0.5759164
[3,] 0.7823572 -1.0328677
[4,] -0.4942740 -0.7169914
[5,] -0.5024906 -0.8067409
>
>
> 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 : 652 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.6726772 -0.2010662 0.3007449 1.381085 1.274651 -0.2273927 0.2801162
col8 col9 col10 col11 col12 col13 col14
row1 0.4813912 0.5588012 1.957348 1.344246 0.07911037 -1.972934 0.05820406
col15 col16 col17 col18 col19 col20
row1 -0.5407998 -2.16546 -0.2715317 -0.3302688 -0.4089651 0.9482271
> tmp[,"col10"]
col10
row1 1.9573478
row2 -0.7355958
row3 -0.8750602
row4 2.2109845
row5 1.3257165
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 0.6726772 -0.2010662 0.3007449 1.3810846 1.2746509 -0.2273927 0.2801162
row5 0.1520667 1.8421332 0.8729670 0.3696925 0.9979186 1.1798213 -0.2625047
col8 col9 col10 col11 col12 col13 col14
row1 0.4813912 0.5588012 1.957348 1.344246 0.07911037 -1.9729344 0.05820406
row5 0.6611542 0.7720694 1.325717 -1.414464 0.61079187 0.1070301 -1.47604828
col15 col16 col17 col18 col19 col20
row1 -0.5407998 -2.1654604 -0.27153169 -0.3302688 -0.4089651 0.9482271
row5 0.8333069 -0.5335951 0.04990073 0.9864744 -0.8108689 0.3533593
> tmp[,c("col6","col20")]
col6 col20
row1 -0.2273927 0.9482271
row2 0.6106751 0.6053124
row3 -1.1550656 -0.3535586
row4 -0.5125665 0.3906770
row5 1.1798213 0.3533593
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.2273927 0.9482271
row5 1.1798213 0.3533593
>
>
>
>
> 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 50.77048 50.31824 51.17655 50.37748 47.89204 105.3309 52.29041 49.22539
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.81938 49.61849 50.02348 49.94939 49.47522 50.68358 50.78799 49.08353
col17 col18 col19 col20
row1 48.01255 51.20897 50.92937 104.8175
> tmp[,"col10"]
col10
row1 49.61849
row2 30.07548
row3 28.52772
row4 30.16075
row5 49.84873
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.77048 50.31824 51.17655 50.37748 47.89204 105.3309 52.29041 49.22539
row5 51.19504 50.68494 48.81270 49.32425 50.01618 104.0932 49.21807 49.77994
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.81938 49.61849 50.02348 49.94939 49.47522 50.68358 50.78799 49.08353
row5 49.08122 49.84873 50.20572 49.03794 49.63129 48.87483 50.02537 47.37434
col17 col18 col19 col20
row1 48.01255 51.20897 50.92937 104.8175
row5 50.90481 48.60301 50.08217 104.9942
> tmp[,c("col6","col20")]
col6 col20
row1 105.33089 104.81751
row2 73.63760 75.15298
row3 76.21380 75.21636
row4 74.49983 74.90554
row5 104.09324 104.99421
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.3309 104.8175
row5 104.0932 104.9942
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.3309 104.8175
row5 104.0932 104.9942
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.36899538
[2,] 0.49038807
[3,] -0.90850193
[4,] 0.06325829
[5,] -0.98279551
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.01772193 -0.2908481
[2,] 0.92611909 -0.9087997
[3,] -0.59985587 0.5069052
[4,] 0.13448578 -0.6564581
[5,] 0.81453043 0.6890191
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.1309029 -0.6581096
[2,] 0.7824249 -1.7932213
[3,] -2.0826082 -0.7342554
[4,] -0.4487344 0.4053896
[5,] 2.9573799 -0.6063737
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.1309029
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.1309029
[2,] 0.7824249
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row3 1.3428076 1.0805777 -0.03914491 -0.3826861 -0.9472046 -0.5910312
row1 -0.5636032 0.9832925 1.98100014 -1.3688341 -0.6015915 0.7752699
[,7] [,8] [,9] [,10] [,11] [,12]
row3 2.3367588 -0.3714364 0.3723901 0.3883511 -0.30519207 -0.1577100
row1 -0.1514444 -0.6393298 -1.5599988 -0.4342313 -0.06326537 0.4701394
[,13] [,14] [,15] [,16] [,17] [,18] [,19]
row3 -1.088129 0.3273547 -1.163376 0.5683457 0.0266403 -0.39087498 -1.914851
row1 1.302089 2.0005970 0.630484 -1.7906278 2.8516209 0.07252396 -1.524222
[,20]
row3 -1.072644
row1 -0.944230
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 1.255025 -0.6081659 -0.4759975 0.116617 -0.7025709 0.2501731 -1.235563
[,8] [,9] [,10]
row2 0.6861332 0.1889642 -1.172707
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.76343 -1.626794 0.7574672 0.1894262 0.7341584 0.3161506 0.07981946
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.8284285 -0.2665885 0.2065948 -0.5426261 1.169042 -0.4095725 -1.076784
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.3589298 1.052845 -0.0688458 1.198197 -0.939407 -2.276936
>
>
> 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: 0x5a268dd4d0e0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f70dc54981655"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f70dc3e9bc5a3"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f70dc26c4fda6"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f70dc4cb8303e"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f70dc5d134b24"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f70dc7c4a46cb"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f70dc7f8b68"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f70dc7bc94f2a"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f70dc5d020cae"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f70dc2264d8de"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f70dc4bf12478"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f70dc48749697"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f70dc194019c6"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f70dc613ce73a"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3f70dc4dd371ba"
>
>
> ### 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: 0x5a268e313760>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5a268e313760>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5a268e313760>
> rowMedians(tmp)
[1] 0.1066740559 -0.3066359538 0.1817738744 -0.1500755075 0.2897355520
[6] -0.1092734008 -0.3379173854 0.1501272402 -0.1289480035 0.0441152076
[11] -0.1335177769 0.1547439718 0.0486053892 -0.1140882697 -0.1453546546
[16] -0.6449624376 0.1039306943 -0.1817564637 -0.0991304883 0.2719984803
[21] -0.0735043833 0.2355733790 0.1916450996 0.2944788637 0.1651393703
[26] 0.2799546153 -0.1529954791 -0.0654115946 0.2764778913 -0.0349855518
[31] 0.0842330498 0.4535709975 0.3391804874 0.0560519085 -0.1767353532
[36] 0.2003034267 0.2392437382 0.3851878644 0.5757555726 -0.1013553290
[41] -0.5570218019 -0.0678257673 -0.0781440485 -0.0168278799 -0.1377976178
[46] 0.5977911116 -0.4784797486 0.2903805350 0.0343245829 0.0148480316
[51] -0.0917245598 -0.8636035058 -0.2646705618 0.2259903406 0.2848704763
[56] -0.0315178800 0.0745905578 0.0992407385 0.1575663053 -0.0391261456
[61] -0.0919093979 0.0178970511 0.0491374066 0.5984928444 0.1733119192
[66] -0.5219504939 -0.3328091417 0.4111491516 0.0999658885 0.1202571982
[71] 0.3160643615 0.0999016682 -0.8264962987 0.0039750322 -0.3100717595
[76] -0.3283675860 -0.1583525289 0.1100425688 0.0419124220 -0.3496196588
[81] -0.3459200196 -0.0869952561 -0.1620471300 0.5541876957 -0.1704113322
[86] -0.5419730982 0.3113244702 -0.1129654037 0.1117881353 -0.1015460338
[91] 0.2070351867 0.1160552119 0.1234420397 -0.2364004788 -0.3188136109
[96] -0.2052610683 0.1873333606 -0.4779889541 0.1390187208 -0.0706147395
[101] 0.1527817504 0.0760517928 -0.3609840137 0.1381402704 0.2481378198
[106] 0.1307380475 -0.2866815803 0.5016378290 0.0356780931 -0.2994569852
[111] -0.0137081134 -0.4220299033 -0.2309113522 0.1250593571 -0.0726224171
[116] 0.3041726149 0.1978364771 0.3583533552 0.0419345380 0.5209489960
[121] -0.0365936986 0.2567222705 0.2156562191 0.1315913705 -0.4315780182
[126] 0.6267411867 -0.2265828710 -0.5055354434 0.3041479883 0.3088083797
[131] -0.0047471745 -0.2001366021 -0.5399759840 0.0422266982 0.2996515553
[136] 0.2765963908 -0.0774271622 -0.2152457725 -0.2310210965 0.0665724227
[141] 0.3637257802 0.0417787184 0.0120986578 -0.0986070053 -0.4305871278
[146] -0.2478757894 -0.6319011539 -0.0545131620 0.1946623466 0.3495076247
[151] -0.3662512098 0.4372517845 -0.1568186692 -0.4122919058 -0.5692753847
[156] 0.2469183059 0.3684140144 0.0200563494 -0.5997925544 0.2162661067
[161] -0.5364922806 -0.3967233119 -0.3990628590 -0.1246471040 0.2376219929
[166] -0.2197878924 -0.1206332877 -0.5571849070 0.3174502287 -0.0263517939
[171] 0.1376300238 -0.3058348855 -0.2478675361 0.4455989590 -0.1435404240
[176] 0.7488665410 0.3490452270 0.6945251428 -0.1228492868 -0.5236809864
[181] 0.3991709698 -0.6032288882 0.5561609342 0.0508404111 0.3465929394
[186] 0.5985099458 0.2342290062 0.3335560965 0.1633292212 0.6992513437
[191] -0.7698645662 -0.1145018568 0.0382631986 -0.5570683666 -0.0321539956
[196] 0.3680335764 0.3976978765 -0.0715813806 -0.2113295207 -0.1636263071
[201] 0.1057416783 0.6974902692 -0.1808938960 -0.0137675291 0.3092452876
[206] -0.4228523406 0.2074733475 0.0383035168 0.3541348230 -0.1874038906
[211] 0.4829893818 -0.0929454032 0.6142777276 0.0168747714 -0.0346070522
[216] 0.1608026191 -0.3701555657 0.2867810511 -0.5934096545 0.1963619579
[221] -0.0031370453 0.3160591113 -0.0004903356 0.0535986890 0.7659483976
[226] -0.7799272211 0.6885721415 0.0354058753 -0.1148189243 0.3551977454
>
> proc.time()
user system elapsed
1.235 0.663 1.886
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: 0x625fd3e19370>
> .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: 0x625fd3e19370>
> .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: 0x625fd3e19370>
> .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: 0x625fd3e19370>
> 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: 0x625fd3e011c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x625fd3e011c0>
> .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: 0x625fd3e011c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x625fd3e011c0>
> .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: 0x625fd3e011c0>
> 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: 0x625fd40e4120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x625fd40e4120>
> .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: 0x625fd40e4120>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x625fd40e4120>
> .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: 0x625fd40e4120>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x625fd40e4120>
> .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: 0x625fd40e4120>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x625fd40e4120>
> .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: 0x625fd40e4120>
> 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: 0x625fd2e34390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x625fd2e34390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x625fd2e34390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x625fd2e34390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3f739b11398b7c" "BufferedMatrixFile3f739b741ab695"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3f739b11398b7c" "BufferedMatrixFile3f739b741ab695"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x625fd2d2b3d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x625fd2d2b3d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x625fd2d2b3d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x625fd2d2b3d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x625fd2d2b3d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x625fd2d2b3d0>
> .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: 0x625fd4860fa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x625fd4860fa0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x625fd4860fa0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x625fd4860fa0>
> 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: 0x625fd3038ff0>
> .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: 0x625fd3038ff0>
> rm(P)
>
> proc.time()
user system elapsed
0.247 0.041 0.278
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.268 0.032 0.287