| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-11-06 12:00 -0500 (Thu, 06 Nov 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" | 4902 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.5.1 Patched (2025-09-10 r88807) -- "Great Square Root" | 4638 |
| 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 | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | 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: 2025-11-05 21:48:38 -0500 (Wed, 05 Nov 2025) |
| EndedAt: 2025-11-05 21:49:02 -0500 (Wed, 05 Nov 2025) |
| EllapsedTime: 24.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.1 Patched (2025-08-23 r88802)
* 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.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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.247 0.041 0.276
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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 478419 25.6 1047111 56 639600 34.2
Vcells 885237 6.8 8388608 64 2081604 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] "Wed Nov 5 21:48:52 2025"
> 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] "Wed Nov 5 21:48:53 2025"
>
>
> 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: 0x5888d099bb10>
>
>
>
> 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] "Wed Nov 5 21:48:53 2025"
> 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] "Wed Nov 5 21:48:53 2025"
>
> ColMode(tmp2)
<pointer: 0x5888d099bb10>
>
>
>
> ### 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.20516128 -0.2440651 -0.7224820 1.0131812
[2,] 0.08357464 1.0089183 0.6305501 -1.3252133
[3,] -1.40325841 -0.7504562 -0.7632363 0.8103518
[4,] 0.35912175 1.2931055 -0.8716729 0.1144923
> 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 : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 101.20516128 0.2440651 0.7224820 1.0131812
[2,] 0.08357464 1.0089183 0.6305501 1.3252133
[3,] 1.40325841 0.7504562 0.7632363 0.8103518
[4,] 0.35912175 1.2931055 0.8716729 0.1144923
> 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 : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0600776 0.4940295 0.8499894 1.0065690
[2,] 0.2890928 1.0044492 0.7940719 1.1511791
[3,] 1.1845921 0.8662888 0.8736340 0.9001954
[4,] 0.5992677 1.1371480 0.9336343 0.3383671
>
> 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 : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 226.80594 30.18436 34.22238 36.07887
[2,] 27.97450 36.05341 33.57127 37.83700
[3,] 38.24918 34.41334 34.49958 34.81231
[4,] 31.35180 37.66459 35.20802 28.49816
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5888cf76e7c0>
> exp(tmp5)
<pointer: 0x5888cf76e7c0>
> log(tmp5,2)
<pointer: 0x5888cf76e7c0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 472.0668
> Min(tmp5)
[1] 53.11309
> mean(tmp5)
[1] 73.10695
> Sum(tmp5)
[1] 14621.39
> Var(tmp5)
[1] 875.0581
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.77357 68.87747 73.01070 72.10745 71.72193 70.74545 71.69693 69.25588
[9] 72.08375 70.79641
> rowSums(tmp5)
[1] 1815.471 1377.549 1460.214 1442.149 1434.439 1414.909 1433.939 1385.118
[9] 1441.675 1415.928
> rowVars(tmp5)
[1] 8179.15087 63.10769 38.74312 87.70670 64.95076 70.28287
[7] 62.47455 56.89627 74.95312 86.07317
> rowSd(tmp5)
[1] 90.438658 7.944035 6.224397 9.365186 8.059204 8.383488 7.904084
[8] 7.542962 8.657547 9.277563
> rowMax(tmp5)
[1] 472.06684 87.24172 83.55756 87.17783 86.04361 83.19162 86.27629
[8] 82.48753 86.46689 94.68398
> rowMin(tmp5)
[1] 57.69010 58.22526 63.11148 54.53240 53.11309 56.27935 57.73356 53.19680
[9] 54.44142 54.11241
>
> colMeans(tmp5)
[1] 108.57020 71.18515 71.71653 73.07814 71.52107 72.89443 69.63112
[8] 66.57773 74.20214 67.39497 69.56819 73.48993 69.32148 72.84130
[15] 73.70191 75.18904 69.39161 69.88222 75.69068 66.29125
> colSums(tmp5)
[1] 1085.7020 711.8515 717.1653 730.7814 715.2107 728.9443 696.3112
[8] 665.7773 742.0214 673.9497 695.6819 734.8993 693.2148 728.4130
[15] 737.0191 751.8904 693.9161 698.8222 756.9068 662.9125
> colVars(tmp5)
[1] 16344.33662 88.93087 74.07265 64.68343 65.63390 37.96258
[7] 117.08532 26.11630 100.39992 40.98208 197.12495 51.88740
[13] 60.53481 71.31279 52.12906 35.53110 82.04685 64.39955
[19] 78.17573 69.09551
> colSd(tmp5)
[1] 127.844971 9.430317 8.606547 8.042601 8.101475 6.161378
[7] 10.820597 5.110411 10.019976 6.401725 14.040119 7.203291
[13] 7.780412 8.444690 7.220046 5.960797 9.057971 8.024933
[19] 8.841704 8.312371
> colMax(tmp5)
[1] 472.06684 82.48753 86.04361 82.35071 85.12256 82.87467 87.24172
[8] 77.47563 87.55020 77.71026 99.93539 85.29549 79.97700 84.21032
[15] 85.01602 81.60957 87.17783 80.59667 94.68398 81.57174
> colMin(tmp5)
[1] 58.22526 54.44142 53.19680 59.10872 60.46920 65.21697 58.11602 57.70087
[9] 56.27935 56.81270 54.53240 60.68149 53.11309 58.43803 62.71949 61.68216
[17] 57.69010 55.89450 62.51373 54.11241
>
>
> ### 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] 90.77357 68.87747 73.01070 72.10745 NA 70.74545 71.69693 69.25588
[9] 72.08375 70.79641
> rowSums(tmp5)
[1] 1815.471 1377.549 1460.214 1442.149 NA 1414.909 1433.939 1385.118
[9] 1441.675 1415.928
> rowVars(tmp5)
[1] 8179.15087 63.10769 38.74312 87.70670 68.13882 70.28287
[7] 62.47455 56.89627 74.95312 86.07317
> rowSd(tmp5)
[1] 90.438658 7.944035 6.224397 9.365186 8.254624 8.383488 7.904084
[8] 7.542962 8.657547 9.277563
> rowMax(tmp5)
[1] 472.06684 87.24172 83.55756 87.17783 NA 83.19162 86.27629
[8] 82.48753 86.46689 94.68398
> rowMin(tmp5)
[1] 57.69010 58.22526 63.11148 54.53240 NA 56.27935 57.73356 53.19680
[9] 54.44142 54.11241
>
> colMeans(tmp5)
[1] 108.57020 71.18515 71.71653 73.07814 71.52107 72.89443 69.63112
[8] 66.57773 74.20214 67.39497 69.56819 73.48993 69.32148 72.84130
[15] NA 75.18904 69.39161 69.88222 75.69068 66.29125
> colSums(tmp5)
[1] 1085.7020 711.8515 717.1653 730.7814 715.2107 728.9443 696.3112
[8] 665.7773 742.0214 673.9497 695.6819 734.8993 693.2148 728.4130
[15] NA 751.8904 693.9161 698.8222 756.9068 662.9125
> colVars(tmp5)
[1] 16344.33662 88.93087 74.07265 64.68343 65.63390 37.96258
[7] 117.08532 26.11630 100.39992 40.98208 197.12495 51.88740
[13] 60.53481 71.31279 NA 35.53110 82.04685 64.39955
[19] 78.17573 69.09551
> colSd(tmp5)
[1] 127.844971 9.430317 8.606547 8.042601 8.101475 6.161378
[7] 10.820597 5.110411 10.019976 6.401725 14.040119 7.203291
[13] 7.780412 8.444690 NA 5.960797 9.057971 8.024933
[19] 8.841704 8.312371
> colMax(tmp5)
[1] 472.06684 82.48753 86.04361 82.35071 85.12256 82.87467 87.24172
[8] 77.47563 87.55020 77.71026 99.93539 85.29549 79.97700 84.21032
[15] NA 81.60957 87.17783 80.59667 94.68398 81.57174
> colMin(tmp5)
[1] 58.22526 54.44142 53.19680 59.10872 60.46920 65.21697 58.11602 57.70087
[9] 56.27935 56.81270 54.53240 60.68149 53.11309 58.43803 NA 61.68216
[17] 57.69010 55.89450 62.51373 54.11241
>
> Max(tmp5,na.rm=TRUE)
[1] 472.0668
> Min(tmp5,na.rm=TRUE)
[1] 53.11309
> mean(tmp5,na.rm=TRUE)
[1] 73.12739
> Sum(tmp5,na.rm=TRUE)
[1] 14552.35
> Var(tmp5,na.rm=TRUE)
[1] 879.3937
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.77357 68.87747 73.01070 72.10745 71.86303 70.74545 71.69693 69.25588
[9] 72.08375 70.79641
> rowSums(tmp5,na.rm=TRUE)
[1] 1815.471 1377.549 1460.214 1442.149 1365.398 1414.909 1433.939 1385.118
[9] 1441.675 1415.928
> rowVars(tmp5,na.rm=TRUE)
[1] 8179.15087 63.10769 38.74312 87.70670 68.13882 70.28287
[7] 62.47455 56.89627 74.95312 86.07317
> rowSd(tmp5,na.rm=TRUE)
[1] 90.438658 7.944035 6.224397 9.365186 8.254624 8.383488 7.904084
[8] 7.542962 8.657547 9.277563
> rowMax(tmp5,na.rm=TRUE)
[1] 472.06684 87.24172 83.55756 87.17783 86.04361 83.19162 86.27629
[8] 82.48753 86.46689 94.68398
> rowMin(tmp5,na.rm=TRUE)
[1] 57.69010 58.22526 63.11148 54.53240 53.11309 56.27935 57.73356 53.19680
[9] 54.44142 54.11241
>
> colMeans(tmp5,na.rm=TRUE)
[1] 108.57020 71.18515 71.71653 73.07814 71.52107 72.89443 69.63112
[8] 66.57773 74.20214 67.39497 69.56819 73.48993 69.32148 72.84130
[15] 74.21979 75.18904 69.39161 69.88222 75.69068 66.29125
> colSums(tmp5,na.rm=TRUE)
[1] 1085.7020 711.8515 717.1653 730.7814 715.2107 728.9443 696.3112
[8] 665.7773 742.0214 673.9497 695.6819 734.8993 693.2148 728.4130
[15] 667.9781 751.8904 693.9161 698.8222 756.9068 662.9125
> colVars(tmp5,na.rm=TRUE)
[1] 16344.33662 88.93087 74.07265 64.68343 65.63390 37.96258
[7] 117.08532 26.11630 100.39992 40.98208 197.12495 51.88740
[13] 60.53481 71.31279 55.62793 35.53110 82.04685 64.39955
[19] 78.17573 69.09551
> colSd(tmp5,na.rm=TRUE)
[1] 127.844971 9.430317 8.606547 8.042601 8.101475 6.161378
[7] 10.820597 5.110411 10.019976 6.401725 14.040119 7.203291
[13] 7.780412 8.444690 7.458413 5.960797 9.057971 8.024933
[19] 8.841704 8.312371
> colMax(tmp5,na.rm=TRUE)
[1] 472.06684 82.48753 86.04361 82.35071 85.12256 82.87467 87.24172
[8] 77.47563 87.55020 77.71026 99.93539 85.29549 79.97700 84.21032
[15] 85.01602 81.60957 87.17783 80.59667 94.68398 81.57174
> colMin(tmp5,na.rm=TRUE)
[1] 58.22526 54.44142 53.19680 59.10872 60.46920 65.21697 58.11602 57.70087
[9] 56.27935 56.81270 54.53240 60.68149 53.11309 58.43803 62.71949 61.68216
[17] 57.69010 55.89450 62.51373 54.11241
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.77357 68.87747 73.01070 72.10745 NaN 70.74545 71.69693 69.25588
[9] 72.08375 70.79641
> rowSums(tmp5,na.rm=TRUE)
[1] 1815.471 1377.549 1460.214 1442.149 0.000 1414.909 1433.939 1385.118
[9] 1441.675 1415.928
> rowVars(tmp5,na.rm=TRUE)
[1] 8179.15087 63.10769 38.74312 87.70670 NA 70.28287
[7] 62.47455 56.89627 74.95312 86.07317
> rowSd(tmp5,na.rm=TRUE)
[1] 90.438658 7.944035 6.224397 9.365186 NA 8.383488 7.904084
[8] 7.542962 8.657547 9.277563
> rowMax(tmp5,na.rm=TRUE)
[1] 472.06684 87.24172 83.55756 87.17783 NA 83.19162 86.27629
[8] 82.48753 86.46689 94.68398
> rowMin(tmp5,na.rm=TRUE)
[1] 57.69010 58.22526 63.11148 54.53240 NA 56.27935 57.73356 53.19680
[9] 54.44142 54.11241
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 113.26672 70.40599 70.12463 73.11291 72.63029 72.59058 70.08300
[8] 66.75349 73.79980 68.16056 69.09018 73.58606 71.12241 72.10651
[15] NaN 75.13863 69.26478 69.86675 75.30041 64.59342
> colSums(tmp5,na.rm=TRUE)
[1] 1019.4004 633.6539 631.1217 658.0162 653.6726 653.3152 630.7470
[8] 600.7814 664.1982 613.4451 621.8116 662.2745 640.1017 648.9586
[15] 0.0000 676.2477 623.3830 628.8007 677.7037 581.3408
> colVars(tmp5,na.rm=TRUE)
[1] 18139.23412 93.21745 54.82266 72.75526 59.99637 41.66925
[7] 129.42372 29.03329 111.12877 39.51088 219.19503 58.26938
[13] 31.61392 74.15292 NA 39.94391 92.12172 72.44680
[19] 86.23417 45.30281
> colSd(tmp5,na.rm=TRUE)
[1] 134.681974 9.654918 7.404233 8.529669 7.745732 6.455172
[7] 11.376455 5.388255 10.541763 6.285768 14.805237 7.633438
[13] 5.622626 8.611209 NA 6.320120 9.598006 8.511569
[19] 9.286235 6.730737
> colMax(tmp5,na.rm=TRUE)
[1] 472.06684 82.48753 80.39327 82.35071 85.12256 82.87467 87.24172
[8] 77.47563 87.55020 77.71026 99.93539 85.29549 79.97700 84.21032
[15] -Inf 81.60957 87.17783 80.59667 94.68398 77.83500
> colMin(tmp5,na.rm=TRUE)
[1] 58.22526 54.44142 53.19680 59.10872 60.46920 65.21697 58.11602 57.70087
[9] 56.27935 56.81270 54.53240 60.68149 62.38454 58.43803 Inf 61.68216
[17] 57.69010 55.89450 62.51373 54.11241
>
>
>
>
> 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] 113.3496 305.6694 237.9801 299.7428 188.6144 142.8646 137.2278 167.3509
[9] 166.6900 218.5021
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 113.3496 305.6694 237.9801 299.7428 188.6144 142.8646 137.2278 167.3509
[9] 166.6900 218.5021
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] 1.136868e-13 -8.526513e-14 0.000000e+00 -1.705303e-13 -1.136868e-13
[6] 1.136868e-13 -5.684342e-14 0.000000e+00 -2.842171e-14 -1.705303e-13
[11] -1.278977e-13 -3.410605e-13 1.705303e-13 0.000000e+00 -1.421085e-13
[16] 2.842171e-14 5.684342e-14 0.000000e+00 -1.136868e-13 1.421085e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
10 6
7 7
3 7
6 9
3 5
6 3
5 13
6 3
2 10
6 7
10 18
4 14
1 15
9 5
1 18
1 10
5 15
8 8
5 14
4 5
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.239123
> Min(tmp)
[1] -2.545196
> mean(tmp)
[1] 0.01987807
> Sum(tmp)
[1] 1.987807
> Var(tmp)
[1] 1.231096
>
> rowMeans(tmp)
[1] 0.01987807
> rowSums(tmp)
[1] 1.987807
> rowVars(tmp)
[1] 1.231096
> rowSd(tmp)
[1] 1.109548
> rowMax(tmp)
[1] 2.239123
> rowMin(tmp)
[1] -2.545196
>
> colMeans(tmp)
[1] 2.23084243 0.08526329 0.43691611 0.03103435 0.75513565 -1.78390712
[7] 0.22988794 1.44186350 0.30353743 0.39434290 -1.09371782 0.51502720
[13] 1.52760879 -1.53545364 0.27760738 -2.18786323 0.17379224 1.32206764
[19] 1.45619775 -1.06971931 -0.25487018 -0.03610762 0.68116805 0.54862096
[25] -0.66528767 -0.48582401 -0.22271382 0.87320127 -0.67556041 -1.43746213
[31] 0.76733680 -0.29941453 -1.99000393 -1.60789743 0.60555835 -0.35923590
[37] -0.72700110 0.96248324 -0.12330526 1.91941779 1.47126313 -0.51699093
[43] 2.15158106 0.49272698 -0.84216884 -0.07984503 -0.62069028 -0.05205426
[49] 1.93082129 -1.85764145 -2.02814319 -0.49199442 -0.11896899 1.93808311
[55] 1.78701917 -1.56054919 0.03060846 -0.87232959 1.66335801 -0.18808207
[61] -0.19815199 2.23912276 -1.26826206 -0.11519929 -0.34069652 0.50790125
[67] -0.12652390 -0.15960501 -0.64518391 1.29036625 -0.40180900 0.60032040
[73] -2.54519625 -0.28118877 -0.63788051 1.13470354 -0.66287028 0.80802385
[79] 0.25066101 1.06475867 -1.76579318 0.76257579 -0.45599063 0.63599010
[85] 1.54666567 -1.19691543 -1.72929397 -1.69497075 0.70360014 0.32618372
[91] -0.50616457 1.10215575 1.96990490 -0.84461684 -0.84843818 -1.19273551
[97] 0.21385795 -0.06323952 0.63933373 0.65283828
> colSums(tmp)
[1] 2.23084243 0.08526329 0.43691611 0.03103435 0.75513565 -1.78390712
[7] 0.22988794 1.44186350 0.30353743 0.39434290 -1.09371782 0.51502720
[13] 1.52760879 -1.53545364 0.27760738 -2.18786323 0.17379224 1.32206764
[19] 1.45619775 -1.06971931 -0.25487018 -0.03610762 0.68116805 0.54862096
[25] -0.66528767 -0.48582401 -0.22271382 0.87320127 -0.67556041 -1.43746213
[31] 0.76733680 -0.29941453 -1.99000393 -1.60789743 0.60555835 -0.35923590
[37] -0.72700110 0.96248324 -0.12330526 1.91941779 1.47126313 -0.51699093
[43] 2.15158106 0.49272698 -0.84216884 -0.07984503 -0.62069028 -0.05205426
[49] 1.93082129 -1.85764145 -2.02814319 -0.49199442 -0.11896899 1.93808311
[55] 1.78701917 -1.56054919 0.03060846 -0.87232959 1.66335801 -0.18808207
[61] -0.19815199 2.23912276 -1.26826206 -0.11519929 -0.34069652 0.50790125
[67] -0.12652390 -0.15960501 -0.64518391 1.29036625 -0.40180900 0.60032040
[73] -2.54519625 -0.28118877 -0.63788051 1.13470354 -0.66287028 0.80802385
[79] 0.25066101 1.06475867 -1.76579318 0.76257579 -0.45599063 0.63599010
[85] 1.54666567 -1.19691543 -1.72929397 -1.69497075 0.70360014 0.32618372
[91] -0.50616457 1.10215575 1.96990490 -0.84461684 -0.84843818 -1.19273551
[97] 0.21385795 -0.06323952 0.63933373 0.65283828
> 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] 2.23084243 0.08526329 0.43691611 0.03103435 0.75513565 -1.78390712
[7] 0.22988794 1.44186350 0.30353743 0.39434290 -1.09371782 0.51502720
[13] 1.52760879 -1.53545364 0.27760738 -2.18786323 0.17379224 1.32206764
[19] 1.45619775 -1.06971931 -0.25487018 -0.03610762 0.68116805 0.54862096
[25] -0.66528767 -0.48582401 -0.22271382 0.87320127 -0.67556041 -1.43746213
[31] 0.76733680 -0.29941453 -1.99000393 -1.60789743 0.60555835 -0.35923590
[37] -0.72700110 0.96248324 -0.12330526 1.91941779 1.47126313 -0.51699093
[43] 2.15158106 0.49272698 -0.84216884 -0.07984503 -0.62069028 -0.05205426
[49] 1.93082129 -1.85764145 -2.02814319 -0.49199442 -0.11896899 1.93808311
[55] 1.78701917 -1.56054919 0.03060846 -0.87232959 1.66335801 -0.18808207
[61] -0.19815199 2.23912276 -1.26826206 -0.11519929 -0.34069652 0.50790125
[67] -0.12652390 -0.15960501 -0.64518391 1.29036625 -0.40180900 0.60032040
[73] -2.54519625 -0.28118877 -0.63788051 1.13470354 -0.66287028 0.80802385
[79] 0.25066101 1.06475867 -1.76579318 0.76257579 -0.45599063 0.63599010
[85] 1.54666567 -1.19691543 -1.72929397 -1.69497075 0.70360014 0.32618372
[91] -0.50616457 1.10215575 1.96990490 -0.84461684 -0.84843818 -1.19273551
[97] 0.21385795 -0.06323952 0.63933373 0.65283828
> colMin(tmp)
[1] 2.23084243 0.08526329 0.43691611 0.03103435 0.75513565 -1.78390712
[7] 0.22988794 1.44186350 0.30353743 0.39434290 -1.09371782 0.51502720
[13] 1.52760879 -1.53545364 0.27760738 -2.18786323 0.17379224 1.32206764
[19] 1.45619775 -1.06971931 -0.25487018 -0.03610762 0.68116805 0.54862096
[25] -0.66528767 -0.48582401 -0.22271382 0.87320127 -0.67556041 -1.43746213
[31] 0.76733680 -0.29941453 -1.99000393 -1.60789743 0.60555835 -0.35923590
[37] -0.72700110 0.96248324 -0.12330526 1.91941779 1.47126313 -0.51699093
[43] 2.15158106 0.49272698 -0.84216884 -0.07984503 -0.62069028 -0.05205426
[49] 1.93082129 -1.85764145 -2.02814319 -0.49199442 -0.11896899 1.93808311
[55] 1.78701917 -1.56054919 0.03060846 -0.87232959 1.66335801 -0.18808207
[61] -0.19815199 2.23912276 -1.26826206 -0.11519929 -0.34069652 0.50790125
[67] -0.12652390 -0.15960501 -0.64518391 1.29036625 -0.40180900 0.60032040
[73] -2.54519625 -0.28118877 -0.63788051 1.13470354 -0.66287028 0.80802385
[79] 0.25066101 1.06475867 -1.76579318 0.76257579 -0.45599063 0.63599010
[85] 1.54666567 -1.19691543 -1.72929397 -1.69497075 0.70360014 0.32618372
[91] -0.50616457 1.10215575 1.96990490 -0.84461684 -0.84843818 -1.19273551
[97] 0.21385795 -0.06323952 0.63933373 0.65283828
> colMedians(tmp)
[1] 2.23084243 0.08526329 0.43691611 0.03103435 0.75513565 -1.78390712
[7] 0.22988794 1.44186350 0.30353743 0.39434290 -1.09371782 0.51502720
[13] 1.52760879 -1.53545364 0.27760738 -2.18786323 0.17379224 1.32206764
[19] 1.45619775 -1.06971931 -0.25487018 -0.03610762 0.68116805 0.54862096
[25] -0.66528767 -0.48582401 -0.22271382 0.87320127 -0.67556041 -1.43746213
[31] 0.76733680 -0.29941453 -1.99000393 -1.60789743 0.60555835 -0.35923590
[37] -0.72700110 0.96248324 -0.12330526 1.91941779 1.47126313 -0.51699093
[43] 2.15158106 0.49272698 -0.84216884 -0.07984503 -0.62069028 -0.05205426
[49] 1.93082129 -1.85764145 -2.02814319 -0.49199442 -0.11896899 1.93808311
[55] 1.78701917 -1.56054919 0.03060846 -0.87232959 1.66335801 -0.18808207
[61] -0.19815199 2.23912276 -1.26826206 -0.11519929 -0.34069652 0.50790125
[67] -0.12652390 -0.15960501 -0.64518391 1.29036625 -0.40180900 0.60032040
[73] -2.54519625 -0.28118877 -0.63788051 1.13470354 -0.66287028 0.80802385
[79] 0.25066101 1.06475867 -1.76579318 0.76257579 -0.45599063 0.63599010
[85] 1.54666567 -1.19691543 -1.72929397 -1.69497075 0.70360014 0.32618372
[91] -0.50616457 1.10215575 1.96990490 -0.84461684 -0.84843818 -1.19273551
[97] 0.21385795 -0.06323952 0.63933373 0.65283828
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 2.230842 0.08526329 0.4369161 0.03103435 0.7551356 -1.783907 0.2298879
[2,] 2.230842 0.08526329 0.4369161 0.03103435 0.7551356 -1.783907 0.2298879
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 1.441863 0.3035374 0.3943429 -1.093718 0.5150272 1.527609 -1.535454
[2,] 1.441863 0.3035374 0.3943429 -1.093718 0.5150272 1.527609 -1.535454
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.2776074 -2.187863 0.1737922 1.322068 1.456198 -1.069719 -0.2548702
[2,] 0.2776074 -2.187863 0.1737922 1.322068 1.456198 -1.069719 -0.2548702
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.03610762 0.6811681 0.548621 -0.6652877 -0.485824 -0.2227138 0.8732013
[2,] -0.03610762 0.6811681 0.548621 -0.6652877 -0.485824 -0.2227138 0.8732013
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.6755604 -1.437462 0.7673368 -0.2994145 -1.990004 -1.607897 0.6055583
[2,] -0.6755604 -1.437462 0.7673368 -0.2994145 -1.990004 -1.607897 0.6055583
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.3592359 -0.7270011 0.9624832 -0.1233053 1.919418 1.471263 -0.5169909
[2,] -0.3592359 -0.7270011 0.9624832 -0.1233053 1.919418 1.471263 -0.5169909
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 2.151581 0.492727 -0.8421688 -0.07984503 -0.6206903 -0.05205426 1.930821
[2,] 2.151581 0.492727 -0.8421688 -0.07984503 -0.6206903 -0.05205426 1.930821
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -1.857641 -2.028143 -0.4919944 -0.118969 1.938083 1.787019 -1.560549
[2,] -1.857641 -2.028143 -0.4919944 -0.118969 1.938083 1.787019 -1.560549
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.03060846 -0.8723296 1.663358 -0.1880821 -0.198152 2.239123 -1.268262
[2,] 0.03060846 -0.8723296 1.663358 -0.1880821 -0.198152 2.239123 -1.268262
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.1151993 -0.3406965 0.5079012 -0.1265239 -0.159605 -0.6451839 1.290366
[2,] -0.1151993 -0.3406965 0.5079012 -0.1265239 -0.159605 -0.6451839 1.290366
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.401809 0.6003204 -2.545196 -0.2811888 -0.6378805 1.134704 -0.6628703
[2,] -0.401809 0.6003204 -2.545196 -0.2811888 -0.6378805 1.134704 -0.6628703
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.8080239 0.250661 1.064759 -1.765793 0.7625758 -0.4559906 0.6359901
[2,] 0.8080239 0.250661 1.064759 -1.765793 0.7625758 -0.4559906 0.6359901
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 1.546666 -1.196915 -1.729294 -1.694971 0.7036001 0.3261837 -0.5061646
[2,] 1.546666 -1.196915 -1.729294 -1.694971 0.7036001 0.3261837 -0.5061646
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 1.102156 1.969905 -0.8446168 -0.8484382 -1.192736 0.2138579 -0.06323952
[2,] 1.102156 1.969905 -0.8446168 -0.8484382 -1.192736 0.2138579 -0.06323952
[,99] [,100]
[1,] 0.6393337 0.6528383
[2,] 0.6393337 0.6528383
>
>
> Max(tmp2)
[1] 2.501417
> Min(tmp2)
[1] -2.87746
> mean(tmp2)
[1] 0.08183611
> Sum(tmp2)
[1] 8.183611
> Var(tmp2)
[1] 1.132997
>
> rowMeans(tmp2)
[1] -1.6506554604 0.4752131632 1.2010731583 -0.1023526413 0.0007961525
[6] 1.7364756081 -1.2281160897 0.6887479009 -1.1288925519 0.4959269834
[11] 1.1433762388 0.4054530367 -1.4574203285 -0.8692579252 1.4371067816
[16] -0.1426540162 1.1438369208 -2.8774600405 0.4259757635 -1.5143691802
[21] 0.0914077191 0.3843843473 1.2254525238 -1.9158958648 0.6266983953
[26] -0.2049651432 1.5861682776 0.3980727828 -0.3744173109 0.6178953010
[31] -0.0676857393 1.3215484778 1.2597547718 -0.2579432287 1.0790048311
[36] 2.0463545160 0.1828426412 -0.5948260990 -1.1833854654 0.6314218592
[41] 0.7494373391 0.0385757150 1.9398158559 -0.1445359613 0.6895696635
[46] 0.8361589609 -0.3667119482 1.4801549797 -0.4856732886 0.4008044268
[51] -0.2316041191 -1.3630455237 -0.2467065821 -1.4737571691 0.8217671722
[56] -2.1244154249 1.3123283630 -0.5364841690 -0.0051070564 0.6949152907
[61] 1.3751931947 1.6009773734 0.1575255182 1.3263478960 -0.1182276609
[66] 0.1891287439 -0.0742897636 1.2751441836 0.6578388083 0.5860487196
[71] -0.2922393635 -0.9684390649 0.7161570724 -0.3167429870 -0.0965601435
[76] -0.0371070744 -0.7727556912 1.0308494181 -0.2949323119 -1.4497194782
[81] -0.4641077189 0.6807713864 -1.1425845338 -0.1864447923 -0.8756422462
[86] -0.0733806270 -0.4298722065 -0.0349527073 -0.1213937896 -0.2229323278
[91] 2.3728745266 -1.5172960064 -1.5267238334 0.9386622341 -2.6927671847
[96] 0.3006007061 0.6149297852 2.5014174423 -0.5944722315 -0.8574495770
> rowSums(tmp2)
[1] -1.6506554604 0.4752131632 1.2010731583 -0.1023526413 0.0007961525
[6] 1.7364756081 -1.2281160897 0.6887479009 -1.1288925519 0.4959269834
[11] 1.1433762388 0.4054530367 -1.4574203285 -0.8692579252 1.4371067816
[16] -0.1426540162 1.1438369208 -2.8774600405 0.4259757635 -1.5143691802
[21] 0.0914077191 0.3843843473 1.2254525238 -1.9158958648 0.6266983953
[26] -0.2049651432 1.5861682776 0.3980727828 -0.3744173109 0.6178953010
[31] -0.0676857393 1.3215484778 1.2597547718 -0.2579432287 1.0790048311
[36] 2.0463545160 0.1828426412 -0.5948260990 -1.1833854654 0.6314218592
[41] 0.7494373391 0.0385757150 1.9398158559 -0.1445359613 0.6895696635
[46] 0.8361589609 -0.3667119482 1.4801549797 -0.4856732886 0.4008044268
[51] -0.2316041191 -1.3630455237 -0.2467065821 -1.4737571691 0.8217671722
[56] -2.1244154249 1.3123283630 -0.5364841690 -0.0051070564 0.6949152907
[61] 1.3751931947 1.6009773734 0.1575255182 1.3263478960 -0.1182276609
[66] 0.1891287439 -0.0742897636 1.2751441836 0.6578388083 0.5860487196
[71] -0.2922393635 -0.9684390649 0.7161570724 -0.3167429870 -0.0965601435
[76] -0.0371070744 -0.7727556912 1.0308494181 -0.2949323119 -1.4497194782
[81] -0.4641077189 0.6807713864 -1.1425845338 -0.1864447923 -0.8756422462
[86] -0.0733806270 -0.4298722065 -0.0349527073 -0.1213937896 -0.2229323278
[91] 2.3728745266 -1.5172960064 -1.5267238334 0.9386622341 -2.6927671847
[96] 0.3006007061 0.6149297852 2.5014174423 -0.5944722315 -0.8574495770
> 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.6506554604 0.4752131632 1.2010731583 -0.1023526413 0.0007961525
[6] 1.7364756081 -1.2281160897 0.6887479009 -1.1288925519 0.4959269834
[11] 1.1433762388 0.4054530367 -1.4574203285 -0.8692579252 1.4371067816
[16] -0.1426540162 1.1438369208 -2.8774600405 0.4259757635 -1.5143691802
[21] 0.0914077191 0.3843843473 1.2254525238 -1.9158958648 0.6266983953
[26] -0.2049651432 1.5861682776 0.3980727828 -0.3744173109 0.6178953010
[31] -0.0676857393 1.3215484778 1.2597547718 -0.2579432287 1.0790048311
[36] 2.0463545160 0.1828426412 -0.5948260990 -1.1833854654 0.6314218592
[41] 0.7494373391 0.0385757150 1.9398158559 -0.1445359613 0.6895696635
[46] 0.8361589609 -0.3667119482 1.4801549797 -0.4856732886 0.4008044268
[51] -0.2316041191 -1.3630455237 -0.2467065821 -1.4737571691 0.8217671722
[56] -2.1244154249 1.3123283630 -0.5364841690 -0.0051070564 0.6949152907
[61] 1.3751931947 1.6009773734 0.1575255182 1.3263478960 -0.1182276609
[66] 0.1891287439 -0.0742897636 1.2751441836 0.6578388083 0.5860487196
[71] -0.2922393635 -0.9684390649 0.7161570724 -0.3167429870 -0.0965601435
[76] -0.0371070744 -0.7727556912 1.0308494181 -0.2949323119 -1.4497194782
[81] -0.4641077189 0.6807713864 -1.1425845338 -0.1864447923 -0.8756422462
[86] -0.0733806270 -0.4298722065 -0.0349527073 -0.1213937896 -0.2229323278
[91] 2.3728745266 -1.5172960064 -1.5267238334 0.9386622341 -2.6927671847
[96] 0.3006007061 0.6149297852 2.5014174423 -0.5944722315 -0.8574495770
> rowMin(tmp2)
[1] -1.6506554604 0.4752131632 1.2010731583 -0.1023526413 0.0007961525
[6] 1.7364756081 -1.2281160897 0.6887479009 -1.1288925519 0.4959269834
[11] 1.1433762388 0.4054530367 -1.4574203285 -0.8692579252 1.4371067816
[16] -0.1426540162 1.1438369208 -2.8774600405 0.4259757635 -1.5143691802
[21] 0.0914077191 0.3843843473 1.2254525238 -1.9158958648 0.6266983953
[26] -0.2049651432 1.5861682776 0.3980727828 -0.3744173109 0.6178953010
[31] -0.0676857393 1.3215484778 1.2597547718 -0.2579432287 1.0790048311
[36] 2.0463545160 0.1828426412 -0.5948260990 -1.1833854654 0.6314218592
[41] 0.7494373391 0.0385757150 1.9398158559 -0.1445359613 0.6895696635
[46] 0.8361589609 -0.3667119482 1.4801549797 -0.4856732886 0.4008044268
[51] -0.2316041191 -1.3630455237 -0.2467065821 -1.4737571691 0.8217671722
[56] -2.1244154249 1.3123283630 -0.5364841690 -0.0051070564 0.6949152907
[61] 1.3751931947 1.6009773734 0.1575255182 1.3263478960 -0.1182276609
[66] 0.1891287439 -0.0742897636 1.2751441836 0.6578388083 0.5860487196
[71] -0.2922393635 -0.9684390649 0.7161570724 -0.3167429870 -0.0965601435
[76] -0.0371070744 -0.7727556912 1.0308494181 -0.2949323119 -1.4497194782
[81] -0.4641077189 0.6807713864 -1.1425845338 -0.1864447923 -0.8756422462
[86] -0.0733806270 -0.4298722065 -0.0349527073 -0.1213937896 -0.2229323278
[91] 2.3728745266 -1.5172960064 -1.5267238334 0.9386622341 -2.6927671847
[96] 0.3006007061 0.6149297852 2.5014174423 -0.5944722315 -0.8574495770
>
> colMeans(tmp2)
[1] 0.08183611
> colSums(tmp2)
[1] 8.183611
> colVars(tmp2)
[1] 1.132997
> colSd(tmp2)
[1] 1.064423
> colMax(tmp2)
[1] 2.501417
> colMin(tmp2)
[1] -2.87746
> colMedians(tmp2)
[1] -0.002155452
> colRanges(tmp2)
[,1]
[1,] -2.877460
[2,] 2.501417
>
> 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] 3.2910255 -1.1600568 -3.3930607 -7.7525250 -1.8567153 -3.4287725
[7] -3.7864833 4.3156794 0.2137558 -0.7073178
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.2660454
[2,] 0.1331344
[3,] 0.4474350
[4,] 0.7582362
[5,] 1.1070468
>
> rowApply(tmp,sum)
[1] 0.1949305 -2.4355002 -0.3390619 0.5801501 -4.8302236 -0.1433923
[7] -0.2101399 -5.3318463 -4.8763395 3.1269522
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 8 7 9 10 7 7 8 9 2 6
[2,] 9 6 6 3 6 4 2 8 7 1
[3,] 10 1 8 5 9 1 1 2 5 4
[4,] 4 3 5 6 5 2 6 1 1 7
[5,] 2 2 10 1 8 8 5 3 10 5
[6,] 3 8 3 8 2 5 7 4 8 2
[7,] 1 5 1 4 1 9 4 10 4 8
[8,] 7 9 2 7 10 6 10 5 6 10
[9,] 5 10 7 9 4 3 9 7 3 3
[10,] 6 4 4 2 3 10 3 6 9 9
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -2.1337000 0.6457879 -0.7607477 -0.5606612 -3.1392443 0.1902777
[7] 0.6615061 0.3346262 -5.0887051 1.8676647 -4.1675778 -1.6268965
[13] 3.5351274 -2.0897096 -1.7757004 1.1803111 1.7496430 -3.5258624
[19] 1.2961427 -3.5265398
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.1875455
[2,] -0.8300565
[3,] -0.3850523
[4,] 0.5934016
[5,] 0.6755527
>
> rowApply(tmp,sum)
[1] 0.1392817 -5.0093796 -4.5669973 -4.6348197 -2.8623430
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 17 6 8 1 18
[2,] 7 20 5 5 10
[3,] 4 12 16 11 8
[4,] 19 10 4 7 13
[5,] 1 19 11 14 1
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.6755527 -0.35473324 -0.7464069 0.8315419 -1.61336376 0.04837354
[2,] -0.8300565 2.70852521 -0.1291094 -0.2339378 0.91240704 0.53494514
[3,] -0.3850523 -0.66986412 0.5204440 -1.0872950 -0.12341112 -0.04239572
[4,] -2.1875455 -1.10024335 -0.2547517 -0.4514434 0.01571908 0.15278827
[5,] 0.5934016 0.06210336 -0.1509237 0.3804731 -2.33059552 -0.50343350
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.2252711 -0.5213488 0.1756070 0.6373236 -1.3774250 0.1493567
[2,] -0.8642605 0.6398288 -2.0089097 -0.0197115 -2.2443025 0.4253229
[3,] 0.3196855 0.2058389 -1.1613302 0.9618128 1.1006346 -0.5255644
[4,] 0.3721709 -0.3612130 -1.1316195 0.4214330 -0.0746988 -0.7958415
[5,] 0.6086391 0.3715203 -0.9624527 -0.1331933 -1.5717860 -0.8801702
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.1837670 -0.4370415 0.8253862 -0.91187264 1.7939905 -0.1618252
[2,] -1.2605010 -0.1324515 -1.0318376 0.31028061 -0.4508916 -0.7268795
[3,] 1.5137634 -0.3543775 -0.3458541 1.30662101 -0.4898931 -1.9450997
[4,] 2.6508671 -0.3635938 -1.6643656 0.37973695 1.2711239 -1.1349408
[5,] 0.4472309 -0.8022452 0.4409707 0.09554517 -0.3746868 0.4428828
[,19] [,20]
[1,] 0.356835840 0.3602925
[2,] 0.034694371 -0.6425346
[3,] 0.007900989 -3.3735613
[4,] -0.085800540 -0.2926015
[5,] 0.982512071 0.4218650
>
>
> 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 : 648 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 : 562 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.05445384 -1.647776 2.199172 -1.076874 1.345439 -1.108156 1.472288
col8 col9 col10 col11 col12 col13 col14
row1 -0.8884376 1.616127 0.9409028 0.07255759 2.090855 1.576446 -0.7713326
col15 col16 col17 col18 col19 col20
row1 1.048323 2.076076 0.1240048 -2.488254 -0.7815347 -0.2835427
> tmp[,"col10"]
col10
row1 0.9409028
row2 1.7526841
row3 0.8163549
row4 -0.5952242
row5 1.3300652
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -0.05445384 -1.647776 2.1991720 -1.076874 1.345439 -1.1081556 1.4722882
row5 0.80555953 -1.735078 0.3315346 -1.636521 -1.071785 -0.7487762 0.8826189
col8 col9 col10 col11 col12 col13 col14
row1 -0.8884376 1.616127 0.9409028 0.07255759 2.0908545 1.5764458 -0.7713326
row5 0.3873986 0.586920 1.3300652 0.69619502 -0.3338173 -0.7538385 -1.5052229
col15 col16 col17 col18 col19 col20
row1 1.048323 2.076076 0.12400482 -2.488254 -0.7815347 -0.2835427
row5 2.542401 -1.465630 -0.04866742 0.558410 -1.8410769 0.8564487
> tmp[,c("col6","col20")]
col6 col20
row1 -1.10815557 -0.2835427
row2 -0.83851684 0.6386464
row3 -0.71276454 0.1621177
row4 0.03731468 1.1446355
row5 -0.74877619 0.8564487
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -1.1081556 -0.2835427
row5 -0.7487762 0.8564487
>
>
>
>
> 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.2063 51.51219 50.02499 49.33051 48.86736 106.1265 49.11938 50.20715
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.40003 50.64935 49.48046 49.83471 51.78597 50.50515 48.97526 50.59762
col17 col18 col19 col20
row1 48.58416 48.92334 49.56588 103.5173
> tmp[,"col10"]
col10
row1 50.64935
row2 30.58870
row3 30.36246
row4 29.44029
row5 49.03814
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.2063 51.51219 50.02499 49.33051 48.86736 106.1265 49.11938 50.20715
row5 49.0668 49.00238 49.64583 47.58510 49.69256 105.2207 47.18159 48.00979
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.40003 50.64935 49.48046 49.83471 51.78597 50.50515 48.97526 50.59762
row5 50.43505 49.03814 52.34067 51.38374 49.97273 51.35997 50.13859 50.11503
col17 col18 col19 col20
row1 48.58416 48.92334 49.56588 103.5173
row5 50.54017 51.03007 50.59223 105.5752
> tmp[,c("col6","col20")]
col6 col20
row1 106.12654 103.51733
row2 73.66614 75.90946
row3 74.96288 77.43510
row4 75.19559 75.94164
row5 105.22066 105.57524
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 106.1265 103.5173
row5 105.2207 105.5752
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 106.1265 103.5173
row5 105.2207 105.5752
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.509346947
[2,] -0.007080843
[3,] 2.431606008
[4,] -0.043756990
[5,] 1.699751326
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.6791103 0.4970328
[2,] -1.0837052 -0.3460637
[3,] -0.3229235 0.5929058
[4,] 2.0610496 -0.6356024
[5,] -0.5036523 1.1627215
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.3608697 0.96294326
[2,] -0.1317205 0.68423188
[3,] -0.3134311 -0.04178335
[4,] 0.0993920 0.06692178
[5,] 0.7407049 0.35828872
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.3608697
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.3608697
[2,] -0.1317205
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row3 1.2087556 -0.6361908 1.3095086 0.08848397 -1.793993 0.6311944 0.4687332
row1 -0.6095756 2.5514103 -0.5024624 0.88630031 -1.042152 -0.2543144 0.1855716
[,8] [,9] [,10] [,11] [,12] [,13]
row3 -1.26825565 -0.9665201 -0.01292236 -0.4884578 1.8403704 -0.2669895
row1 0.06719713 -0.3379007 -0.43401017 0.2762251 0.2932351 -0.4918028
[,14] [,15] [,16] [,17] [,18] [,19]
row3 -0.2564513 -0.6667137 0.06063619 -0.6567485 0.3313841 0.3496636
row1 0.5194872 0.2110302 -0.51134387 -0.6979572 -0.9719370 0.7183266
[,20]
row3 0.15439056
row1 0.09773684
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.8323329 -0.6529103 -0.1933226 -0.09417235 1.077366 -0.4952856 0.3070154
[,8] [,9] [,10]
row2 -0.2568982 0.9584716 0.5243239
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.2454997 -0.2926906 -0.3165263 0.3731111 -1.423376 0.5754674 -0.2418234
[,8] [,9] [,10] [,11] [,12] [,13]
row5 -0.6981782 -0.802141 -0.1328516 -0.05259713 -0.4247902 1.307754
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.01193899 -0.4367115 -0.1145003 -1.011725 -0.2097001 -2.13752 -1.009958
>
>
> 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: 0x5888d19d1460>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8fa526d01656c"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8fa522343f6e4"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8fa52306afa89"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8fa521779b627"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8fa5219d5c2c3"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8fa524bae5156"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8fa52348c58ff"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8fa523a0315f7"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8fa5236472a38"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8fa52123047dd"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8fa527a4f1c54"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8fa5258610e10"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8fa526a152b26"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8fa52e748e84"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM8fa528cbaf2a"
>
>
> ### 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: 0x5888cf633610>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5888cf633610>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5888cf633610>
> rowMedians(tmp)
[1] 0.608772701 0.489669477 -0.377041939 -0.302527205 -0.423748077
[6] -0.413208591 0.327339718 0.469620672 -0.029295378 0.374236219
[11] 0.062876364 0.078532646 0.517462295 0.464629746 -0.014697133
[16] 0.072118189 0.149914678 -0.135017791 0.331529349 -0.194149099
[21] -0.010670576 -0.252304371 0.114460227 -0.204912048 0.294188825
[26] 0.200378951 -0.308648625 -0.188848793 0.243654981 0.157359015
[31] -0.085814073 0.115296528 -0.389696380 -0.215751810 -0.418317732
[36] 0.564409898 -0.315565340 0.168232876 0.086823780 -0.094518197
[41] 0.199988913 0.037877751 -0.479364165 -0.185827862 -0.707132192
[46] 0.315823723 -0.347756519 0.069606913 -0.017300821 -0.098340940
[51] 0.031578449 0.675316935 -0.672906313 0.385306135 -0.167199562
[56] -0.006731304 0.262510737 -0.172269254 0.120411653 -0.412279790
[61] 0.255392236 -0.335331152 0.353362814 -0.060016837 0.182808777
[66] 0.138046649 -0.385999725 0.036865316 -0.223323922 0.189255658
[71] -0.491220968 0.025206304 -0.049680432 0.030196618 0.120693470
[76] 0.279794149 -0.021366490 0.967847919 0.415743167 -0.705433549
[81] 0.255833119 -0.275571178 0.219951836 0.130795707 -0.019334724
[86] 0.179798823 -0.481345375 0.171869643 0.169736617 0.105874883
[91] -0.150515180 -0.350337330 0.015393239 -0.250330418 -0.013756961
[96] 0.213387098 -0.136578209 -0.028532227 0.541174168 -0.669842356
[101] 0.032511905 0.290231386 0.015066145 -0.034605615 -0.085256080
[106] 0.356017793 -0.336834256 0.234774785 -0.039004603 0.207222498
[111] -0.227935327 -0.279745219 0.165362131 0.305582290 -0.267584903
[116] 0.325426601 0.198145855 0.065449710 -0.521593718 0.060627350
[121] -0.289815067 0.543639730 -0.473626231 0.190154922 0.093446467
[126] 0.468412637 0.355076661 0.157451557 0.542945608 -0.095039297
[131] 0.073195939 -0.100225662 -0.620922263 -0.206003175 -0.345898410
[136] -0.407808575 -0.058480308 -0.522274059 0.035531545 0.013934193
[141] 0.323458103 0.074162575 0.374144078 -0.103354568 -0.525450943
[146] -0.398704116 -0.193216847 0.219109730 0.158433363 0.114640310
[151] -0.883136740 -0.093113934 0.352967308 0.527997740 0.027763660
[156] 0.078674739 -0.188687144 0.333603404 -0.402065111 0.177170527
[161] 0.182417538 0.090521438 0.066237929 -0.302540440 -0.106576168
[166] -0.544700412 0.237678727 -0.104600605 0.101420690 0.534360944
[171] -0.408180958 0.216105553 0.192578083 -0.460431879 0.597591444
[176] 0.440181915 -0.299986004 0.296304956 -0.077608012 0.094283597
[181] 0.213613175 -0.086610754 0.107013097 0.299929815 0.268936208
[186] -0.491429160 -0.014087553 0.356731757 0.354556651 0.288799684
[191] -0.571669123 -0.143796671 0.151753914 -0.007789959 -0.034788698
[196] 0.060561047 -0.016828909 0.029701631 -0.847315899 -0.243357842
[201] -0.502805831 -0.062602089 -0.316153390 -0.021555756 -0.262322594
[206] 0.382786085 -0.523786637 0.069054203 0.384336112 0.361025101
[211] 0.283228925 0.229901512 0.029987361 0.074548487 0.073110684
[216] -0.073465014 -0.209513770 0.001605968 -0.018216020 0.126359181
[221] -0.316813253 0.049902184 0.176137006 0.717344075 -0.247268803
[226] -0.101637447 -0.491331482 -0.029314901 -0.308940246 0.394997327
>
> proc.time()
user system elapsed
1.242 0.669 1.899
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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: 0x6541f86d3b10>
> .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: 0x6541f86d3b10>
> .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: 0x6541f86d3b10>
> .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: 0x6541f86d3b10>
> 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: 0x6541f72baa00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6541f72baa00>
> .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: 0x6541f72baa00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6541f72baa00>
> .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: 0x6541f72baa00>
> 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: 0x6541f78e0fd0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6541f78e0fd0>
> .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: 0x6541f78e0fd0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6541f78e0fd0>
> .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: 0x6541f78e0fd0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x6541f78e0fd0>
> .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: 0x6541f78e0fd0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x6541f78e0fd0>
> .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: 0x6541f78e0fd0>
> 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: 0x6541f9a043b0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6541f9a043b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6541f9a043b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6541f9a043b0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile8faeb4b610919" "BufferedMatrixFile8faeb5888e774"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile8faeb4b610919" "BufferedMatrixFile8faeb5888e774"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6541f7efefe0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6541f7efefe0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6541f7efefe0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6541f7efefe0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6541f7efefe0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6541f7efefe0>
> .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: 0x6541f8134060>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6541f8134060>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6541f8134060>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6541f8134060>
> 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: 0x6541f7385660>
> .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: 0x6541f7385660>
> rm(P)
>
> proc.time()
user system elapsed
0.247 0.050 0.283
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root"
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.240 0.041 0.269