| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2026-01-08 11:58 -0500 (Thu, 08 Jan 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" | 4883 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4671 |
| 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 | |||||||||
| taishan | Linux (openEuler 24.03 LTS) / aarch64 | OK | OK | OK | ||||||||||
|
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-01-05 21:36:49 -0500 (Mon, 05 Jan 2026) |
| EndedAt: 2026-01-05 21:37:14 -0500 (Mon, 05 Jan 2026) |
| EllapsedTime: 25.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.253 0.048 0.290
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478284 25.6 1046725 56 639600 34.2
Vcells 884773 6.8 8388608 64 2081613 15.9
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Mon Jan 5 21:37:05 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Mon Jan 5 21:37:05 2026"
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
>
>
> RowMode(tmp2)
<pointer: 0x5e29a7cf4370>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Mon Jan 5 21:37:05 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Mon Jan 5 21:37:05 2026"
>
> ColMode(tmp2)
<pointer: 0x5e29a7cf4370>
>
>
>
> ### 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,] 99.0992317 1.6973553 0.8293458 -1.2648598
[2,] -1.0101913 -1.6162354 -1.3187239 1.7702550
[3,] 0.4530583 0.2130462 -0.8161661 2.2328642
[4,] 0.4347857 -1.6302533 1.0411326 0.2319498
> 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,] 99.0992317 1.6973553 0.8293458 1.2648598
[2,] 1.0101913 1.6162354 1.3187239 1.7702550
[3,] 0.4530583 0.2130462 0.8161661 2.2328642
[4,] 0.4347857 1.6302533 1.0411326 0.2319498
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 9.9548597 1.3028259 0.9106842 1.1246598
[2,] 1.0050827 1.2713125 1.1483570 1.3305093
[3,] 0.6730960 0.4615693 0.9034191 1.4942771
[4,] 0.6593828 1.2768137 1.0203591 0.4816117
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 223.64783 39.72561 34.93619 37.51146
[2,] 36.06102 39.32936 37.80229 40.07535
[3,] 32.18402 29.82874 34.85036 42.17564
[4,] 32.02861 39.39839 36.24472 30.04807
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5e29a8cf09b0>
> exp(tmp5)
<pointer: 0x5e29a8cf09b0>
> log(tmp5,2)
<pointer: 0x5e29a8cf09b0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 465.4937
> Min(tmp5)
[1] 56.00317
> mean(tmp5)
[1] 73.79537
> Sum(tmp5)
[1] 14759.07
> Var(tmp5)
[1] 848.358
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 92.03547 76.78751 71.72873 72.44731 70.83199 68.85479 70.78969 71.56786
[9] 71.72213 71.18816
> rowSums(tmp5)
[1] 1840.709 1535.750 1434.575 1448.946 1416.640 1377.096 1415.794 1431.357
[9] 1434.443 1423.763
> rowVars(tmp5)
[1] 7836.40876 41.97800 62.99451 45.41760 62.70137 60.81045
[7] 86.28035 88.89248 102.57386 69.98110
> rowSd(tmp5)
[1] 88.523493 6.479043 7.936908 6.739258 7.918419 7.798105 9.288722
[8] 9.428281 10.127875 8.365471
> rowMax(tmp5)
[1] 465.49365 85.61641 87.78306 85.20530 82.00769 84.51826 93.98772
[8] 89.19186 90.45771 94.03362
> rowMin(tmp5)
[1] 58.69846 60.90375 60.50953 62.54111 57.17522 56.00317 56.07149 57.41403
[9] 56.34761 59.22591
>
> colMeans(tmp5)
[1] 111.86863 74.44223 77.11127 70.18882 67.94963 64.88085 78.10654
[8] 69.71529 74.42866 68.99275 73.61243 68.60106 75.20054 72.94144
[15] 70.83983 73.07680 69.54793 72.75904 75.26081 66.38274
> colSums(tmp5)
[1] 1118.6863 744.4223 771.1127 701.8882 679.4963 648.8085 781.0654
[8] 697.1529 744.2866 689.9275 736.1243 686.0106 752.0054 729.4144
[15] 708.3983 730.7680 695.4793 727.5904 752.6081 663.8274
> colVars(tmp5)
[1] 15451.54351 54.26946 22.13304 127.45380 66.39783 51.57609
[7] 80.11169 96.23736 123.42273 31.29923 65.98817 84.68491
[13] 29.04448 77.24563 84.33086 45.43963 85.73225 93.25594
[19] 93.19509 37.53807
> colSd(tmp5)
[1] 124.304238 7.366781 4.704577 11.289544 8.148487 7.181650
[7] 8.950513 9.810064 11.109578 5.594572 8.123310 9.202440
[13] 5.389293 8.788950 9.183184 6.740892 9.259171 9.656912
[19] 9.653760 6.126832
> colMax(tmp5)
[1] 465.49365 82.68366 85.33455 87.78306 81.67975 77.92613 93.98772
[8] 85.21805 94.03362 74.67593 88.21928 83.46061 82.19229 89.19186
[15] 85.20530 81.18107 79.48527 86.61316 91.93680 78.73101
> colMin(tmp5)
[1] 66.66336 62.08461 70.61005 56.00317 57.49561 56.47990 60.04682 57.17522
[9] 60.17762 59.38219 61.90809 57.65692 67.57193 59.53777 58.69846 61.01247
[17] 56.07149 60.28124 63.89079 58.70268
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 92.03547 76.78751 71.72873 72.44731 70.83199 68.85479 70.78969 71.56786
[9] 71.72213 NA
> rowSums(tmp5)
[1] 1840.709 1535.750 1434.575 1448.946 1416.640 1377.096 1415.794 1431.357
[9] 1434.443 NA
> rowVars(tmp5)
[1] 7836.40876 41.97800 62.99451 45.41760 62.70137 60.81045
[7] 86.28035 88.89248 102.57386 65.50079
> rowSd(tmp5)
[1] 88.523493 6.479043 7.936908 6.739258 7.918419 7.798105 9.288722
[8] 9.428281 10.127875 8.093256
> rowMax(tmp5)
[1] 465.49365 85.61641 87.78306 85.20530 82.00769 84.51826 93.98772
[8] 89.19186 90.45771 NA
> rowMin(tmp5)
[1] 58.69846 60.90375 60.50953 62.54111 57.17522 56.00317 56.07149 57.41403
[9] 56.34761 NA
>
> colMeans(tmp5)
[1] 111.86863 74.44223 77.11127 70.18882 67.94963 NA 78.10654
[8] 69.71529 74.42866 68.99275 73.61243 68.60106 75.20054 72.94144
[15] 70.83983 73.07680 69.54793 72.75904 75.26081 66.38274
> colSums(tmp5)
[1] 1118.6863 744.4223 771.1127 701.8882 679.4963 NA 781.0654
[8] 697.1529 744.2866 689.9275 736.1243 686.0106 752.0054 729.4144
[15] 708.3983 730.7680 695.4793 727.5904 752.6081 663.8274
> colVars(tmp5)
[1] 15451.54351 54.26946 22.13304 127.45380 66.39783 NA
[7] 80.11169 96.23736 123.42273 31.29923 65.98817 84.68491
[13] 29.04448 77.24563 84.33086 45.43963 85.73225 93.25594
[19] 93.19509 37.53807
> colSd(tmp5)
[1] 124.304238 7.366781 4.704577 11.289544 8.148487 NA
[7] 8.950513 9.810064 11.109578 5.594572 8.123310 9.202440
[13] 5.389293 8.788950 9.183184 6.740892 9.259171 9.656912
[19] 9.653760 6.126832
> colMax(tmp5)
[1] 465.49365 82.68366 85.33455 87.78306 81.67975 NA 93.98772
[8] 85.21805 94.03362 74.67593 88.21928 83.46061 82.19229 89.19186
[15] 85.20530 81.18107 79.48527 86.61316 91.93680 78.73101
> colMin(tmp5)
[1] 66.66336 62.08461 70.61005 56.00317 57.49561 NA 60.04682 57.17522
[9] 60.17762 59.38219 61.90809 57.65692 67.57193 59.53777 58.69846 61.01247
[17] 56.07149 60.28124 63.89079 58.70268
>
> Max(tmp5,na.rm=TRUE)
[1] 465.4937
> Min(tmp5,na.rm=TRUE)
[1] 56.00317
> mean(tmp5,na.rm=TRUE)
[1] 73.86858
> Sum(tmp5,na.rm=TRUE)
[1] 14699.85
> Var(tmp5,na.rm=TRUE)
[1] 851.5651
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 92.03547 76.78751 71.72873 72.44731 70.83199 68.85479 70.78969 71.56786
[9] 71.72213 71.81776
> rowSums(tmp5,na.rm=TRUE)
[1] 1840.709 1535.750 1434.575 1448.946 1416.640 1377.096 1415.794 1431.357
[9] 1434.443 1364.537
> rowVars(tmp5,na.rm=TRUE)
[1] 7836.40876 41.97800 62.99451 45.41760 62.70137 60.81045
[7] 86.28035 88.89248 102.57386 65.50079
> rowSd(tmp5,na.rm=TRUE)
[1] 88.523493 6.479043 7.936908 6.739258 7.918419 7.798105 9.288722
[8] 9.428281 10.127875 8.093256
> rowMax(tmp5,na.rm=TRUE)
[1] 465.49365 85.61641 87.78306 85.20530 82.00769 84.51826 93.98772
[8] 89.19186 90.45771 94.03362
> rowMin(tmp5,na.rm=TRUE)
[1] 58.69846 60.90375 60.50953 62.54111 57.17522 56.00317 56.07149 57.41403
[9] 56.34761 59.38219
>
> colMeans(tmp5,na.rm=TRUE)
[1] 111.86863 74.44223 77.11127 70.18882 67.94963 65.50918 78.10654
[8] 69.71529 74.42866 68.99275 73.61243 68.60106 75.20054 72.94144
[15] 70.83983 73.07680 69.54793 72.75904 75.26081 66.38274
> colSums(tmp5,na.rm=TRUE)
[1] 1118.6863 744.4223 771.1127 701.8882 679.4963 589.5826 781.0654
[8] 697.1529 744.2866 689.9275 736.1243 686.0106 752.0054 729.4144
[15] 708.3983 730.7680 695.4793 727.5904 752.6081 663.8274
> colVars(tmp5,na.rm=TRUE)
[1] 15451.54351 54.26946 22.13304 127.45380 66.39783 53.58166
[7] 80.11169 96.23736 123.42273 31.29923 65.98817 84.68491
[13] 29.04448 77.24563 84.33086 45.43963 85.73225 93.25594
[19] 93.19509 37.53807
> colSd(tmp5,na.rm=TRUE)
[1] 124.304238 7.366781 4.704577 11.289544 8.148487 7.319950
[7] 8.950513 9.810064 11.109578 5.594572 8.123310 9.202440
[13] 5.389293 8.788950 9.183184 6.740892 9.259171 9.656912
[19] 9.653760 6.126832
> colMax(tmp5,na.rm=TRUE)
[1] 465.49365 82.68366 85.33455 87.78306 81.67975 77.92613 93.98772
[8] 85.21805 94.03362 74.67593 88.21928 83.46061 82.19229 89.19186
[15] 85.20530 81.18107 79.48527 86.61316 91.93680 78.73101
> colMin(tmp5,na.rm=TRUE)
[1] 66.66336 62.08461 70.61005 56.00317 57.49561 56.47990 60.04682 57.17522
[9] 60.17762 59.38219 61.90809 57.65692 67.57193 59.53777 58.69846 61.01247
[17] 56.07149 60.28124 63.89079 58.70268
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 92.03547 76.78751 71.72873 72.44731 70.83199 68.85479 70.78969 71.56786
[9] 71.72213 NaN
> rowSums(tmp5,na.rm=TRUE)
[1] 1840.709 1535.750 1434.575 1448.946 1416.640 1377.096 1415.794 1431.357
[9] 1434.443 0.000
> rowVars(tmp5,na.rm=TRUE)
[1] 7836.40876 41.97800 62.99451 45.41760 62.70137 60.81045
[7] 86.28035 88.89248 102.57386 NA
> rowSd(tmp5,na.rm=TRUE)
[1] 88.523493 6.479043 7.936908 6.739258 7.918419 7.798105 9.288722
[8] 9.428281 10.127875 NA
> rowMax(tmp5,na.rm=TRUE)
[1] 465.49365 85.61641 87.78306 85.20530 82.00769 84.51826 93.98772
[8] 89.19186 90.45771 NA
> rowMin(tmp5,na.rm=TRUE)
[1] 58.69846 60.90375 60.50953 62.54111 57.17522 56.00317 56.07149 57.41403
[9] 56.34761 NA
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 116.08512 75.04958 77.32583 71.23064 67.10268 NaN 78.04545
[8] 70.32315 72.25034 70.06060 73.88206 67.18946 75.32596 73.06287
[15] 71.08300 73.02326 70.50257 73.34167 75.21661 66.09105
> colSums(tmp5,na.rm=TRUE)
[1] 1044.7661 675.4463 695.9325 641.0758 603.9241 0.0000 702.4090
[8] 632.9084 650.2530 630.5454 664.9385 604.7052 677.9336 657.5658
[15] 639.7470 657.2093 634.5232 660.0751 676.9495 594.8195
> colVars(tmp5,na.rm=TRUE)
[1] 17182.97485 56.90331 24.38178 131.17474 66.62770 NA
[7] 90.08366 104.11017 85.46803 22.38344 73.41879 72.85355
[13] 32.49808 86.73547 94.20701 51.08733 86.19610 101.09392
[19] 104.82249 41.27319
> colSd(tmp5,na.rm=TRUE)
[1] 131.083847 7.543428 4.937791 11.453154 8.162579 NA
[7] 9.491241 10.203439 9.244892 4.731114 8.568477 8.535429
[13] 5.700709 9.313188 9.706030 7.147540 9.284185 10.054547
[19] 10.238285 6.424422
> colMax(tmp5,na.rm=TRUE)
[1] 465.49365 82.68366 85.33455 87.78306 81.67975 -Inf 93.98772
[8] 85.21805 90.45771 74.67593 88.21928 83.46061 82.19229 89.19186
[15] 85.20530 81.18107 79.48527 86.61316 91.93680 78.73101
> colMin(tmp5,na.rm=TRUE)
[1] 66.66336 62.08461 70.61005 56.00317 57.49561 Inf 60.04682 57.17522
[9] 60.17762 63.76750 61.90809 57.65692 67.57193 59.53777 58.69846 61.01247
[17] 56.07149 60.28124 63.89079 58.70268
>
>
>
>
> 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] 174.7206 185.4330 197.5025 226.8317 242.4290 282.4350 162.4018 187.5939
[9] 254.4069 206.1768
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 174.7206 185.4330 197.5025 226.8317 242.4290 282.4350 162.4018 187.5939
[9] 254.4069 206.1768
>
>
>
> 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] -5.684342e-14 1.136868e-13 5.684342e-14 1.136868e-13 -5.684342e-14
[6] -1.136868e-13 -1.136868e-13 5.684342e-14 -3.410605e-13 1.136868e-13
[11] 0.000000e+00 1.421085e-14 -2.842171e-14 0.000000e+00 -1.989520e-13
[16] 1.705303e-13 7.105427e-15 -1.136868e-13 2.842171e-14 1.705303e-13
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
6 8
4 18
9 7
3 17
10 20
1 20
4 7
6 9
4 5
2 1
8 20
2 19
1 8
8 20
3 10
8 2
8 3
7 16
10 1
8 4
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.454296
> Min(tmp)
[1] -2.187786
> mean(tmp)
[1] 0.08950978
> Sum(tmp)
[1] 8.950978
> Var(tmp)
[1] 1.090032
>
> rowMeans(tmp)
[1] 0.08950978
> rowSums(tmp)
[1] 8.950978
> rowVars(tmp)
[1] 1.090032
> rowSd(tmp)
[1] 1.044046
> rowMax(tmp)
[1] 2.454296
> rowMin(tmp)
[1] -2.187786
>
> colMeans(tmp)
[1] 0.334053206 1.777706384 -0.619372071 0.900701495 0.562994772
[6] 0.651130130 -0.007035063 -1.770644664 -0.386051011 -0.390414595
[11] -0.477794812 0.116116072 0.018195451 1.426001489 -1.153375443
[16] -0.251789815 0.192298039 -0.204397119 -0.282444648 -0.467928629
[21] 0.375868588 0.179101565 1.205581033 1.359480057 0.093958479
[26] -0.311815925 -1.556654812 0.876413371 1.306643888 1.918655355
[31] -1.430026311 -0.722912126 -0.512701494 -0.907125063 -1.038637316
[36] -0.340521553 -1.013101326 -0.003923768 -0.493905265 1.620474209
[41] -0.089003780 -1.114390883 -1.324879796 1.530719557 0.441003400
[46] 0.493219962 1.957357781 1.139150108 0.843608742 -0.060847179
[51] -0.517402304 0.340159405 1.596019345 -0.035216853 -0.402341157
[56] 1.339923281 -0.303229566 0.298605700 -0.329185219 -1.486880544
[61] 2.119178179 1.059329172 0.529275947 1.516731266 2.454296206
[66] 0.134108756 1.502436172 1.382023106 0.197097743 1.515148063
[71] -0.839016291 -0.453709877 -0.490594183 -1.761725094 -1.360275820
[76] -0.400369581 1.517273653 -0.344634285 0.059374844 -1.798166732
[81] 0.328954603 -0.655055310 0.237654088 -2.187785675 -0.944998164
[86] 2.060205922 -1.339377939 -0.339474577 -1.458091749 1.176012185
[91] 0.208214272 1.470363242 0.362499694 -0.137019331 -0.142675712
[96] 1.327414665 0.270051267 -1.647213062 -0.606375840 -0.459296118
> colSums(tmp)
[1] 0.334053206 1.777706384 -0.619372071 0.900701495 0.562994772
[6] 0.651130130 -0.007035063 -1.770644664 -0.386051011 -0.390414595
[11] -0.477794812 0.116116072 0.018195451 1.426001489 -1.153375443
[16] -0.251789815 0.192298039 -0.204397119 -0.282444648 -0.467928629
[21] 0.375868588 0.179101565 1.205581033 1.359480057 0.093958479
[26] -0.311815925 -1.556654812 0.876413371 1.306643888 1.918655355
[31] -1.430026311 -0.722912126 -0.512701494 -0.907125063 -1.038637316
[36] -0.340521553 -1.013101326 -0.003923768 -0.493905265 1.620474209
[41] -0.089003780 -1.114390883 -1.324879796 1.530719557 0.441003400
[46] 0.493219962 1.957357781 1.139150108 0.843608742 -0.060847179
[51] -0.517402304 0.340159405 1.596019345 -0.035216853 -0.402341157
[56] 1.339923281 -0.303229566 0.298605700 -0.329185219 -1.486880544
[61] 2.119178179 1.059329172 0.529275947 1.516731266 2.454296206
[66] 0.134108756 1.502436172 1.382023106 0.197097743 1.515148063
[71] -0.839016291 -0.453709877 -0.490594183 -1.761725094 -1.360275820
[76] -0.400369581 1.517273653 -0.344634285 0.059374844 -1.798166732
[81] 0.328954603 -0.655055310 0.237654088 -2.187785675 -0.944998164
[86] 2.060205922 -1.339377939 -0.339474577 -1.458091749 1.176012185
[91] 0.208214272 1.470363242 0.362499694 -0.137019331 -0.142675712
[96] 1.327414665 0.270051267 -1.647213062 -0.606375840 -0.459296118
> 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.334053206 1.777706384 -0.619372071 0.900701495 0.562994772
[6] 0.651130130 -0.007035063 -1.770644664 -0.386051011 -0.390414595
[11] -0.477794812 0.116116072 0.018195451 1.426001489 -1.153375443
[16] -0.251789815 0.192298039 -0.204397119 -0.282444648 -0.467928629
[21] 0.375868588 0.179101565 1.205581033 1.359480057 0.093958479
[26] -0.311815925 -1.556654812 0.876413371 1.306643888 1.918655355
[31] -1.430026311 -0.722912126 -0.512701494 -0.907125063 -1.038637316
[36] -0.340521553 -1.013101326 -0.003923768 -0.493905265 1.620474209
[41] -0.089003780 -1.114390883 -1.324879796 1.530719557 0.441003400
[46] 0.493219962 1.957357781 1.139150108 0.843608742 -0.060847179
[51] -0.517402304 0.340159405 1.596019345 -0.035216853 -0.402341157
[56] 1.339923281 -0.303229566 0.298605700 -0.329185219 -1.486880544
[61] 2.119178179 1.059329172 0.529275947 1.516731266 2.454296206
[66] 0.134108756 1.502436172 1.382023106 0.197097743 1.515148063
[71] -0.839016291 -0.453709877 -0.490594183 -1.761725094 -1.360275820
[76] -0.400369581 1.517273653 -0.344634285 0.059374844 -1.798166732
[81] 0.328954603 -0.655055310 0.237654088 -2.187785675 -0.944998164
[86] 2.060205922 -1.339377939 -0.339474577 -1.458091749 1.176012185
[91] 0.208214272 1.470363242 0.362499694 -0.137019331 -0.142675712
[96] 1.327414665 0.270051267 -1.647213062 -0.606375840 -0.459296118
> colMin(tmp)
[1] 0.334053206 1.777706384 -0.619372071 0.900701495 0.562994772
[6] 0.651130130 -0.007035063 -1.770644664 -0.386051011 -0.390414595
[11] -0.477794812 0.116116072 0.018195451 1.426001489 -1.153375443
[16] -0.251789815 0.192298039 -0.204397119 -0.282444648 -0.467928629
[21] 0.375868588 0.179101565 1.205581033 1.359480057 0.093958479
[26] -0.311815925 -1.556654812 0.876413371 1.306643888 1.918655355
[31] -1.430026311 -0.722912126 -0.512701494 -0.907125063 -1.038637316
[36] -0.340521553 -1.013101326 -0.003923768 -0.493905265 1.620474209
[41] -0.089003780 -1.114390883 -1.324879796 1.530719557 0.441003400
[46] 0.493219962 1.957357781 1.139150108 0.843608742 -0.060847179
[51] -0.517402304 0.340159405 1.596019345 -0.035216853 -0.402341157
[56] 1.339923281 -0.303229566 0.298605700 -0.329185219 -1.486880544
[61] 2.119178179 1.059329172 0.529275947 1.516731266 2.454296206
[66] 0.134108756 1.502436172 1.382023106 0.197097743 1.515148063
[71] -0.839016291 -0.453709877 -0.490594183 -1.761725094 -1.360275820
[76] -0.400369581 1.517273653 -0.344634285 0.059374844 -1.798166732
[81] 0.328954603 -0.655055310 0.237654088 -2.187785675 -0.944998164
[86] 2.060205922 -1.339377939 -0.339474577 -1.458091749 1.176012185
[91] 0.208214272 1.470363242 0.362499694 -0.137019331 -0.142675712
[96] 1.327414665 0.270051267 -1.647213062 -0.606375840 -0.459296118
> colMedians(tmp)
[1] 0.334053206 1.777706384 -0.619372071 0.900701495 0.562994772
[6] 0.651130130 -0.007035063 -1.770644664 -0.386051011 -0.390414595
[11] -0.477794812 0.116116072 0.018195451 1.426001489 -1.153375443
[16] -0.251789815 0.192298039 -0.204397119 -0.282444648 -0.467928629
[21] 0.375868588 0.179101565 1.205581033 1.359480057 0.093958479
[26] -0.311815925 -1.556654812 0.876413371 1.306643888 1.918655355
[31] -1.430026311 -0.722912126 -0.512701494 -0.907125063 -1.038637316
[36] -0.340521553 -1.013101326 -0.003923768 -0.493905265 1.620474209
[41] -0.089003780 -1.114390883 -1.324879796 1.530719557 0.441003400
[46] 0.493219962 1.957357781 1.139150108 0.843608742 -0.060847179
[51] -0.517402304 0.340159405 1.596019345 -0.035216853 -0.402341157
[56] 1.339923281 -0.303229566 0.298605700 -0.329185219 -1.486880544
[61] 2.119178179 1.059329172 0.529275947 1.516731266 2.454296206
[66] 0.134108756 1.502436172 1.382023106 0.197097743 1.515148063
[71] -0.839016291 -0.453709877 -0.490594183 -1.761725094 -1.360275820
[76] -0.400369581 1.517273653 -0.344634285 0.059374844 -1.798166732
[81] 0.328954603 -0.655055310 0.237654088 -2.187785675 -0.944998164
[86] 2.060205922 -1.339377939 -0.339474577 -1.458091749 1.176012185
[91] 0.208214272 1.470363242 0.362499694 -0.137019331 -0.142675712
[96] 1.327414665 0.270051267 -1.647213062 -0.606375840 -0.459296118
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.3340532 1.777706 -0.6193721 0.9007015 0.5629948 0.6511301 -0.007035063
[2,] 0.3340532 1.777706 -0.6193721 0.9007015 0.5629948 0.6511301 -0.007035063
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -1.770645 -0.386051 -0.3904146 -0.4777948 0.1161161 0.01819545 1.426001
[2,] -1.770645 -0.386051 -0.3904146 -0.4777948 0.1161161 0.01819545 1.426001
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -1.153375 -0.2517898 0.192298 -0.2043971 -0.2824446 -0.4679286 0.3758686
[2,] -1.153375 -0.2517898 0.192298 -0.2043971 -0.2824446 -0.4679286 0.3758686
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.1791016 1.205581 1.35948 0.09395848 -0.3118159 -1.556655 0.8764134
[2,] 0.1791016 1.205581 1.35948 0.09395848 -0.3118159 -1.556655 0.8764134
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 1.306644 1.918655 -1.430026 -0.7229121 -0.5127015 -0.9071251 -1.038637
[2,] 1.306644 1.918655 -1.430026 -0.7229121 -0.5127015 -0.9071251 -1.038637
[,36] [,37] [,38] [,39] [,40] [,41]
[1,] -0.3405216 -1.013101 -0.003923768 -0.4939053 1.620474 -0.08900378
[2,] -0.3405216 -1.013101 -0.003923768 -0.4939053 1.620474 -0.08900378
[,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -1.114391 -1.32488 1.53072 0.4410034 0.49322 1.957358 1.13915 0.8436087
[2,] -1.114391 -1.32488 1.53072 0.4410034 0.49322 1.957358 1.13915 0.8436087
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.06084718 -0.5174023 0.3401594 1.596019 -0.03521685 -0.4023412 1.339923
[2,] -0.06084718 -0.5174023 0.3401594 1.596019 -0.03521685 -0.4023412 1.339923
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.3032296 0.2986057 -0.3291852 -1.486881 2.119178 1.059329 0.5292759
[2,] -0.3032296 0.2986057 -0.3291852 -1.486881 2.119178 1.059329 0.5292759
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 1.516731 2.454296 0.1341088 1.502436 1.382023 0.1970977 1.515148
[2,] 1.516731 2.454296 0.1341088 1.502436 1.382023 0.1970977 1.515148
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.8390163 -0.4537099 -0.4905942 -1.761725 -1.360276 -0.4003696 1.517274
[2,] -0.8390163 -0.4537099 -0.4905942 -1.761725 -1.360276 -0.4003696 1.517274
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.3446343 0.05937484 -1.798167 0.3289546 -0.6550553 0.2376541 -2.187786
[2,] -0.3446343 0.05937484 -1.798167 0.3289546 -0.6550553 0.2376541 -2.187786
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.9449982 2.060206 -1.339378 -0.3394746 -1.458092 1.176012 0.2082143
[2,] -0.9449982 2.060206 -1.339378 -0.3394746 -1.458092 1.176012 0.2082143
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 1.470363 0.3624997 -0.1370193 -0.1426757 1.327415 0.2700513 -1.647213
[2,] 1.470363 0.3624997 -0.1370193 -0.1426757 1.327415 0.2700513 -1.647213
[,99] [,100]
[1,] -0.6063758 -0.4592961
[2,] -0.6063758 -0.4592961
>
>
> Max(tmp2)
[1] 2.556754
> Min(tmp2)
[1] -1.98475
> mean(tmp2)
[1] 0.1380477
> Sum(tmp2)
[1] 13.80477
> Var(tmp2)
[1] 0.9751976
>
> rowMeans(tmp2)
[1] 1.164403382 -0.756713765 0.318322022 0.971885321 0.450208931
[6] -0.427227222 -0.582587292 0.981666340 -0.542287599 0.699429970
[11] 0.091323378 -0.815235129 0.517446508 -0.431750036 0.058164076
[16] -1.984749863 -0.047810378 -0.539832675 0.818489319 -0.255236762
[21] -0.896949063 1.168112844 0.854913173 0.966358954 0.609823241
[26] -0.636771425 1.455894493 -0.386976012 -0.001022651 -0.201640725
[31] -0.017712481 -0.625735706 1.298573449 0.982132240 1.982936021
[36] -1.570819192 -1.898963665 -0.066080009 -0.654450202 0.146408726
[41] -1.771035480 -0.428532080 -1.740795460 -0.214550317 -1.289885050
[46] -0.259100430 2.340829117 -0.670655539 0.962179298 0.605932756
[51] -0.450524267 1.211164387 0.394439257 -0.635996783 0.746701818
[56] -1.799736594 -0.201224028 -0.708974751 0.071383428 1.183208651
[61] -0.629750548 -0.016603164 0.524787230 2.013467562 -0.656605778
[66] 0.255052388 0.660963570 -0.093176827 1.158165186 -1.265538477
[71] 0.362917209 0.429008954 0.796688029 -0.387962017 -0.648586929
[76] -0.493121964 -1.371904931 0.028745543 0.224210047 1.343487752
[81] -0.653876480 -0.529562756 2.556753683 1.153148903 0.679296435
[86] -1.067681485 0.849058346 0.533394706 0.519016015 0.279852749
[91] -0.987593574 0.212057017 2.523006669 0.932962471 0.044335201
[96] 0.297845648 1.465114082 1.093268783 2.398607783 -0.269245737
> rowSums(tmp2)
[1] 1.164403382 -0.756713765 0.318322022 0.971885321 0.450208931
[6] -0.427227222 -0.582587292 0.981666340 -0.542287599 0.699429970
[11] 0.091323378 -0.815235129 0.517446508 -0.431750036 0.058164076
[16] -1.984749863 -0.047810378 -0.539832675 0.818489319 -0.255236762
[21] -0.896949063 1.168112844 0.854913173 0.966358954 0.609823241
[26] -0.636771425 1.455894493 -0.386976012 -0.001022651 -0.201640725
[31] -0.017712481 -0.625735706 1.298573449 0.982132240 1.982936021
[36] -1.570819192 -1.898963665 -0.066080009 -0.654450202 0.146408726
[41] -1.771035480 -0.428532080 -1.740795460 -0.214550317 -1.289885050
[46] -0.259100430 2.340829117 -0.670655539 0.962179298 0.605932756
[51] -0.450524267 1.211164387 0.394439257 -0.635996783 0.746701818
[56] -1.799736594 -0.201224028 -0.708974751 0.071383428 1.183208651
[61] -0.629750548 -0.016603164 0.524787230 2.013467562 -0.656605778
[66] 0.255052388 0.660963570 -0.093176827 1.158165186 -1.265538477
[71] 0.362917209 0.429008954 0.796688029 -0.387962017 -0.648586929
[76] -0.493121964 -1.371904931 0.028745543 0.224210047 1.343487752
[81] -0.653876480 -0.529562756 2.556753683 1.153148903 0.679296435
[86] -1.067681485 0.849058346 0.533394706 0.519016015 0.279852749
[91] -0.987593574 0.212057017 2.523006669 0.932962471 0.044335201
[96] 0.297845648 1.465114082 1.093268783 2.398607783 -0.269245737
> 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] 1.164403382 -0.756713765 0.318322022 0.971885321 0.450208931
[6] -0.427227222 -0.582587292 0.981666340 -0.542287599 0.699429970
[11] 0.091323378 -0.815235129 0.517446508 -0.431750036 0.058164076
[16] -1.984749863 -0.047810378 -0.539832675 0.818489319 -0.255236762
[21] -0.896949063 1.168112844 0.854913173 0.966358954 0.609823241
[26] -0.636771425 1.455894493 -0.386976012 -0.001022651 -0.201640725
[31] -0.017712481 -0.625735706 1.298573449 0.982132240 1.982936021
[36] -1.570819192 -1.898963665 -0.066080009 -0.654450202 0.146408726
[41] -1.771035480 -0.428532080 -1.740795460 -0.214550317 -1.289885050
[46] -0.259100430 2.340829117 -0.670655539 0.962179298 0.605932756
[51] -0.450524267 1.211164387 0.394439257 -0.635996783 0.746701818
[56] -1.799736594 -0.201224028 -0.708974751 0.071383428 1.183208651
[61] -0.629750548 -0.016603164 0.524787230 2.013467562 -0.656605778
[66] 0.255052388 0.660963570 -0.093176827 1.158165186 -1.265538477
[71] 0.362917209 0.429008954 0.796688029 -0.387962017 -0.648586929
[76] -0.493121964 -1.371904931 0.028745543 0.224210047 1.343487752
[81] -0.653876480 -0.529562756 2.556753683 1.153148903 0.679296435
[86] -1.067681485 0.849058346 0.533394706 0.519016015 0.279852749
[91] -0.987593574 0.212057017 2.523006669 0.932962471 0.044335201
[96] 0.297845648 1.465114082 1.093268783 2.398607783 -0.269245737
> rowMin(tmp2)
[1] 1.164403382 -0.756713765 0.318322022 0.971885321 0.450208931
[6] -0.427227222 -0.582587292 0.981666340 -0.542287599 0.699429970
[11] 0.091323378 -0.815235129 0.517446508 -0.431750036 0.058164076
[16] -1.984749863 -0.047810378 -0.539832675 0.818489319 -0.255236762
[21] -0.896949063 1.168112844 0.854913173 0.966358954 0.609823241
[26] -0.636771425 1.455894493 -0.386976012 -0.001022651 -0.201640725
[31] -0.017712481 -0.625735706 1.298573449 0.982132240 1.982936021
[36] -1.570819192 -1.898963665 -0.066080009 -0.654450202 0.146408726
[41] -1.771035480 -0.428532080 -1.740795460 -0.214550317 -1.289885050
[46] -0.259100430 2.340829117 -0.670655539 0.962179298 0.605932756
[51] -0.450524267 1.211164387 0.394439257 -0.635996783 0.746701818
[56] -1.799736594 -0.201224028 -0.708974751 0.071383428 1.183208651
[61] -0.629750548 -0.016603164 0.524787230 2.013467562 -0.656605778
[66] 0.255052388 0.660963570 -0.093176827 1.158165186 -1.265538477
[71] 0.362917209 0.429008954 0.796688029 -0.387962017 -0.648586929
[76] -0.493121964 -1.371904931 0.028745543 0.224210047 1.343487752
[81] -0.653876480 -0.529562756 2.556753683 1.153148903 0.679296435
[86] -1.067681485 0.849058346 0.533394706 0.519016015 0.279852749
[91] -0.987593574 0.212057017 2.523006669 0.932962471 0.044335201
[96] 0.297845648 1.465114082 1.093268783 2.398607783 -0.269245737
>
> colMeans(tmp2)
[1] 0.1380477
> colSums(tmp2)
[1] 13.80477
> colVars(tmp2)
[1] 0.9751976
> colSd(tmp2)
[1] 0.9875209
> colMax(tmp2)
[1] 2.556754
> colMin(tmp2)
[1] -1.98475
> colMedians(tmp2)
[1] 0.06477375
> colRanges(tmp2)
[,1]
[1,] -1.984750
[2,] 2.556754
>
> 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] 4.9514399 1.8045166 -2.8229601 3.9976717 0.5006550 -2.8456285
[7] -0.8256269 2.8868844 -5.6083184 -4.7994112
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.9900603
[2,] -0.6619038
[3,] 0.4803686
[4,] 1.2929479
[5,] 2.3491988
>
> rowApply(tmp,sum)
[1] -1.28575839 2.42619012 -1.65739676 -1.62028791 -5.28452019 -3.27702753
[7] 5.86995946 0.51883405 1.47222858 0.07700096
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 7 3 3 10 4 8 2 10 9 10
[2,] 4 2 7 9 5 10 7 7 6 5
[3,] 3 10 8 5 3 3 5 6 1 2
[4,] 8 7 6 6 10 7 9 2 8 6
[5,] 5 8 1 2 6 9 6 4 3 8
[6,] 9 6 4 1 9 2 3 1 4 9
[7,] 2 9 9 7 8 5 1 3 5 7
[8,] 1 5 10 8 2 6 10 5 10 3
[9,] 6 1 5 3 7 4 4 8 7 1
[10,] 10 4 2 4 1 1 8 9 2 4
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -2.2880959 1.0167125 1.5963965 -3.1615914 0.1591242 0.8920475
[7] 0.0302077 -2.8683454 -0.7375374 2.5295172 0.7020947 1.6959412
[13] -2.5484698 -2.6059852 -2.9217803 -6.0664169 5.5694126 1.1561417
[19] 3.6992437 1.5624748
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.3059159
[2,] -1.2685053
[3,] -1.2126657
[4,] -0.2714647
[5,] 1.7704557
>
> rowApply(tmp,sum)
[1] -5.2246289 -2.8540656 -0.8304086 5.1535325 1.1666623
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 5 19 3 3 9
[2,] 16 16 9 7 7
[3,] 12 14 16 10 10
[4,] 19 4 6 2 1
[5,] 11 15 10 5 13
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -1.3059159 0.60420973 -0.01296209 1.3577340 -0.30591795 -0.65309901
[2,] 1.7704557 0.94767552 0.42838105 -1.1504560 0.87466288 0.06905409
[3,] -1.2685053 -0.12338411 0.66549125 -0.2910474 -0.08592837 -0.20797609
[4,] -1.2126657 -0.08632044 0.31572721 -1.3975450 -0.76285177 1.03264873
[5,] -0.2714647 -0.32546815 0.19975907 -1.6802770 0.43915942 0.65141976
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.9069566 -1.7139776 -0.5718481 -0.01028895 -1.7000794 -1.317422
[2,] -1.1039321 -2.1400285 -0.4628118 -0.06292179 0.2031605 2.176238
[3,] 0.5306866 0.4928895 0.1416860 -0.17731532 1.2039885 -2.229371
[4,] 1.0193719 0.8165892 1.0452885 1.85873299 0.4353432 1.037168
[5,] -1.3228753 -0.3238180 -0.8898519 0.92131027 0.5596819 2.029328
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.66886119 -0.5520682 0.2390902 -2.13832275 -0.5082253 -0.3513743
[2,] -3.34549161 -1.1069727 -1.6441185 0.04697076 1.0067050 0.0528907
[3,] 1.15011993 -0.5891285 -1.4410585 -1.11699218 0.9216364 0.2757957
[4,] 0.01767415 0.2034435 -0.2785864 -1.67463381 2.0175875 0.5288301
[5,] -1.03963348 -0.5612593 0.2028929 -1.18343896 2.1317090 0.6499996
[,19] [,20]
[1,] 1.7053970 0.4346238
[2,] -0.5063692 1.0928426
[3,] 0.8133730 0.5046311
[4,] 1.0503958 -0.8126646
[5,] 0.6364470 0.3430418
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 653 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 -0.8082836 -2.02719 1.479991 0.6679551 -0.3315174 0.8708067 -1.079382
col8 col9 col10 col11 col12 col13 col14
row1 -0.5778487 -1.823412 -0.1134209 -0.943085 -0.2118685 1.379915 -0.5504358
col15 col16 col17 col18 col19 col20
row1 0.2082065 0.09964192 0.6137821 0.9829207 2.0725 1.426555
> tmp[,"col10"]
col10
row1 -0.1134209
row2 1.1199745
row3 -1.3221294
row4 1.6418546
row5 -1.2954819
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -0.8082836 -2.027190 1.4799911 0.6679551 -0.3315174 0.8708067 -1.0793824
row5 -1.9798112 1.292934 0.1004672 -1.4401899 0.5283851 0.3145625 -0.9157703
col8 col9 col10 col11 col12 col13
row1 -0.5778487 -1.823412 -0.1134209 -0.9430850 -0.2118685 1.3799149
row5 -2.1316378 2.017516 -1.2954819 0.7489609 1.1656213 -0.3488461
col14 col15 col16 col17 col18 col19 col20
row1 -0.5504358 0.2082065 0.09964192 0.613782108 0.9829207 2.072500 1.426555
row5 1.8743532 -0.8882082 0.19197902 0.001748882 -1.3741824 1.595629 0.111070
> tmp[,c("col6","col20")]
col6 col20
row1 0.8708067 1.4265552
row2 1.7533526 -1.8332797
row3 -0.2529704 -1.3789449
row4 -0.8456399 -0.2900445
row5 0.3145625 0.1110700
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.8708067 1.426555
row5 0.3145625 0.111070
>
>
>
>
> 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.7915 51.30031 51.09163 49.22277 51.24048 105.2537 50.59008 49.42185
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.86083 48.93937 51.69444 49.9401 51.20476 50.43914 50.20577 49.2719
col17 col18 col19 col20
row1 50.09814 49.6035 50.26342 104.7771
> tmp[,"col10"]
col10
row1 48.93937
row2 30.08449
row3 28.44217
row4 28.99360
row5 50.23700
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.79150 51.30031 51.09163 49.22277 51.24048 105.2537 50.59008 49.42185
row5 50.75971 48.90761 49.54526 50.95549 48.50123 106.4005 53.24123 51.52301
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.86083 48.93937 51.69444 49.94010 51.20476 50.43914 50.20577 49.27190
row5 47.57703 50.23700 50.76001 50.72571 50.38117 49.81475 50.31502 50.90433
col17 col18 col19 col20
row1 50.09814 49.60350 50.26342 104.7771
row5 50.59580 51.61499 51.19669 104.5402
> tmp[,c("col6","col20")]
col6 col20
row1 105.25368 104.77706
row2 75.00241 75.78798
row3 73.65182 75.40477
row4 73.76950 76.68772
row5 106.40052 104.54017
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.2537 104.7771
row5 106.4005 104.5402
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.2537 104.7771
row5 106.4005 104.5402
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 1.0929701
[2,] -1.3966870
[3,] -1.1270054
[4,] 0.9241238
[5,] -0.1774060
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.06460721 0.07420949
[2,] -0.41026057 -1.11167123
[3,] 1.12994497 -2.13848449
[4,] 0.53554257 2.42063285
[5,] 0.58368715 1.10639588
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.1035169 0.3172797
[2,] -1.3466679 -1.5936215
[3,] -0.2865871 0.9671845
[4,] -0.9128194 0.7927871
[5,] -0.2820810 1.9037578
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.1035169
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.1035169
[2,] -1.3466679
>
>
>
> 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.2533586 -0.9232057 -1.529486 -0.5073718 2.1443128 -0.8752671 0.6392748
row1 0.1328645 0.7809131 -1.273380 0.9001863 -0.3592301 1.1736657 -0.7819899
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 -0.8555243 1.742769 0.7235190 0.1448111 1.2338059 1.6395087 -0.2964879
row1 -0.9070589 -1.803198 -0.5581698 2.0993352 0.1510145 0.9022467 0.3368775
[,15] [,16] [,17] [,18] [,19] [,20]
row3 1.17052503 0.1045196 -1.2355303 -1.4741543 0.3861406 1.124356
row1 0.05171638 -0.2447807 -0.3625125 -0.8655722 -0.3230970 1.046429
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.2701112 -0.6826506 0.9189859 -0.1634592 -0.06050827 -1.909944 2.275934
[,8] [,9] [,10]
row2 -0.2919473 1.067926 0.7844691
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.01163693 -0.3107486 2.394315 1.273312 0.2101349 2.079982 -2.163647
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.3831523 -0.3184641 -0.7432453 0.7792976 -0.6905512 1.339662 1.185263
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -1.430274 -1.231999 0.6921275 -0.5607017 0.4945045 0.8406132
>
>
> 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: 0x5e29a926b5d0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29f9895ccc8acb"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29f9893244c2e0"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29f989513fb987"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29f98925bf04f7"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29f9892847852a"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29f989587b74eb"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29f9892f9f9396"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29f98946161ee8"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29f98922fdd57b"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29f98967df8ec"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29f989613a3063"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29f98911fa4d77"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29f98922157709"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29f989682a8ccc"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM29f989654d359b"
>
>
> ### 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: 0x5e29a8e67d70>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5e29a8e67d70>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5e29a8e67d70>
> rowMedians(tmp)
[1] -0.0005091523 -0.3494541103 -0.4462379196 0.1560961699 0.1419567006
[6] 0.3265520771 0.3827378886 0.2092744931 -0.5284650085 0.0880144258
[11] 0.7860306775 -0.2853211924 -0.0976876727 0.2891024725 -0.1227485366
[16] 0.0649801905 -0.6214578801 0.5817255751 0.1596803729 -0.1310757470
[21] 0.1547713760 0.0910703002 0.7358188886 0.0916755661 0.0041734517
[26] 0.3697281805 0.1318824050 0.2749141185 -0.3512330623 0.0339413177
[31] 0.6497102431 0.0447950108 0.0654118691 0.0490036262 0.3139537488
[36] 0.0620179158 0.1026691361 -0.0076391877 -0.1059053526 0.4077461194
[41] 0.3478026453 -0.2790345972 -0.1229504857 -0.2294248935 0.3633661698
[46] 0.0908241554 0.0746372550 -0.1136156434 -0.2284518420 0.1960822542
[51] 0.1895223097 0.1865520671 -0.0715485205 0.1309653443 -0.1334023223
[56] 0.3317613729 0.3780524980 0.3070457767 -0.4174271731 -0.5655801165
[61] -0.0557614775 -0.6377605603 -0.1818583395 -0.1838678639 -0.1838974938
[66] 0.0249029127 -0.1372508234 -0.0204359810 -0.1401149327 -0.0231082989
[71] -0.3796253039 0.2072625011 0.5663857956 0.5805625414 -0.2948786448
[76] -0.1770909056 -0.1702751068 0.1795143110 -0.1575071164 -0.3329027251
[81] -0.2572454754 -0.1665406027 -0.2213885057 0.0954177453 -0.0461592104
[86] -0.2235257495 0.0192242137 -0.1399317720 0.1419974047 -0.1280897053
[91] 0.1760290557 0.0811998498 -0.3414060068 -0.1033793138 0.1670452604
[96] -0.1284225732 0.2600745075 -0.1078853432 -0.1217050298 -0.3528648287
[101] -0.5784729591 0.0279320083 0.0333761854 0.4664835501 0.2444239545
[106] 0.1425757140 -0.0289067991 -0.2063862721 0.2627651079 -0.3037733770
[111] 0.6513929484 0.2090028624 -0.0678200598 -0.0100442472 0.3550162963
[116] -0.0481692435 0.4697511567 0.6480625865 0.2393951926 -0.2283081236
[121] 0.3614183983 -0.2959418484 -0.3533195267 0.0528580905 -0.1530976456
[126] -0.2690574612 -0.0158233584 0.0432276026 -0.0911047782 -0.9034320402
[131] 0.3914868340 -0.1946430172 0.0925102015 -0.1115574338 0.5474419093
[136] -0.2199585340 -0.5954798610 -0.4715654104 0.1967818314 -0.2187172073
[141] 0.0764019758 -0.7740097150 0.2724019808 -0.0446673091 -0.2865370916
[146] -0.1378010019 -0.2769705861 0.3950624803 -0.4223624427 -0.0661917721
[151] 0.0028172304 0.1035178615 -0.0337942172 0.1234156995 0.0034383388
[156] 0.2099549767 0.0935638311 -0.1583406859 -0.3545488334 -0.0258903362
[161] 0.1084015223 0.3386963532 -0.5346677099 0.0425734308 0.2896566219
[166] -0.5756086189 -0.5666557583 0.0244726592 0.0388177287 -0.2753357416
[171] -0.6504591777 -0.0333188880 0.8432287616 0.1448516287 0.1859551696
[176] 0.5205526612 0.1277204555 0.1545360317 0.4465532738 0.2041513619
[181] 0.3664194027 -0.4987889922 0.6051645200 -0.2059565183 -0.2042539148
[186] -0.5336912856 -0.0335756985 -0.4771154695 0.2456537619 0.0745319142
[191] 0.2868011126 0.1348205916 -0.2095006331 -0.0396683966 0.2475745145
[196] -0.1267463510 0.3896445982 0.7971853845 0.4360916845 0.2572462927
[201] -0.0996471616 -0.3596356920 0.0709643871 0.6530427189 0.2224433252
[206] -0.1219626155 -0.0384554401 -0.4575490906 0.4162562758 0.5337641632
[211] 0.0025849744 -0.0355332330 -0.1396182618 -0.4246578611 -0.2538647204
[216] -0.2627392889 -0.3333197643 -0.0021803165 0.6541065549 -0.1302230374
[221] -0.0894158471 -0.0485326641 -0.2715617634 0.0147273271 0.2976612203
[226] 0.0576734205 0.0359284420 0.1013682912 0.0974441173 -0.0357901683
>
> proc.time()
user system elapsed
1.251 0.704 1.945
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: 0x633651dd4370>
> .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: 0x633651dd4370>
> .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: 0x633651dd4370>
> .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: 0x633651dd4370>
> 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: 0x633651dbc1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x633651dbc1c0>
> .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: 0x633651dbc1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x633651dbc1c0>
> .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: 0x633651dbc1c0>
> 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: 0x63365209f120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x63365209f120>
> .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: 0x63365209f120>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x63365209f120>
> .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: 0x63365209f120>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x63365209f120>
> .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: 0x63365209f120>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x63365209f120>
> .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: 0x63365209f120>
> 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: 0x633650def390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x633650def390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x633650def390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x633650def390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile29f9e75a43aa53" "BufferedMatrixFile29f9e779adbdb4"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile29f9e75a43aa53" "BufferedMatrixFile29f9e779adbdb4"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x633650ce63d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x633650ce63d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x633650ce63d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x633650ce63d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x633650ce63d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x633650ce63d0>
> .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: 0x63365281bfa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x63365281bfa0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x63365281bfa0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x63365281bfa0>
> 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: 0x633650ff3ff0>
> .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: 0x633650ff3ff0>
> rm(P)
>
> proc.time()
user system elapsed
0.257 0.038 0.285
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.239 0.044 0.272