| Back to Multiple platform build/check report for BioC 3.24: simplified long |
|
This page was generated on 2026-05-23 11:35 -0400 (Sat, 23 May 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.4 LTS) | x86_64 | 4.6.0 RC (2026-04-17 r89917) -- "Because it was There" | 4937 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.6.0 Patched (2026-05-01 r89994) -- "Because it was There" | 4639 |
| 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 259/2379 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.77.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.4 LTS) / x86_64 | OK | OK | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | ||||||||||
| See other builds for BufferedMatrix in R Universe. | ||||||||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.77.0 |
| Command: /home/biocbuild/bbs-3.24-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.24-bioc/R/site-library --timings BufferedMatrix_1.77.0.tar.gz |
| StartedAt: 2026-05-22 21:56:26 -0400 (Fri, 22 May 2026) |
| EndedAt: 2026-05-22 21:56:54 -0400 (Fri, 22 May 2026) |
| EllapsedTime: 28.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.24-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.24-bioc/R/site-library --timings BufferedMatrix_1.77.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.6.0 RC (2026-04-17 r89917)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
* running under: Ubuntu 24.04.4 LTS
* using session charset: UTF-8
* current time: 2026-05-23 01:56:26 UTC
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.77.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.1) 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 ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* 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: 1 NOTE
See
‘/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.24-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.24-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.77.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.24-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.24-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.24-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.24-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.24-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.24-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.24-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.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 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.25 0.05 0.29
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 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.24-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 480233 25.7 1053308 56.3 637571 34.1
Vcells 887253 6.8 8388608 64.0 2083896 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] "Fri May 22 21:56:45 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] "Fri May 22 21:56:45 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: 0x62fd9413b520>
>
>
>
> 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] "Fri May 22 21:56:45 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] "Fri May 22 21:56:45 2026"
>
> ColMode(tmp2)
<pointer: 0x62fd9413b520>
>
>
>
> ### 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.9770729 -2.7241132 -1.1822180 1.5872615
[2,] 0.3280318 -0.1537646 -0.4638532 1.0849948
[3,] -0.5131383 0.5222486 0.3781841 0.2646372
[4,] -1.0600760 1.6118167 -0.4054647 0.5884179
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-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.9770729 2.7241132 1.1822180 1.5872615
[2,] 0.3280318 0.1537646 0.4638532 1.0849948
[3,] 0.5131383 0.5222486 0.3781841 0.2646372
[4,] 1.0600760 1.6118167 0.4054647 0.5884179
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-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.9988536 1.6504888 1.0872985 1.259866
[2,] 0.5727406 0.3921283 0.6810677 1.041631
[3,] 0.7163367 0.7226677 0.6149668 0.514429
[4,] 1.0295999 1.2695734 0.6367611 0.767084
>
> 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.24-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,] 224.96561 44.22900 37.05520 39.18592
[2,] 31.05544 29.07505 32.27453 36.50130
[3,] 32.67651 32.74893 31.52785 30.40893
[4,] 36.35608 39.30755 31.77308 33.25926
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x62fd94f268f0>
> exp(tmp5)
<pointer: 0x62fd94f268f0>
> log(tmp5,2)
<pointer: 0x62fd94f268f0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.2364
> Min(tmp5)
[1] 53.24535
> mean(tmp5)
[1] 72.35068
> Sum(tmp5)
[1] 14470.14
> Var(tmp5)
[1] 868.5496
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 93.49945 69.81456 72.41302 70.77096 70.58299 71.47799 68.41159 66.72934
[9] 69.14219 70.66476
> rowSums(tmp5)
[1] 1869.989 1396.291 1448.260 1415.419 1411.660 1429.560 1368.232 1334.587
[9] 1382.844 1413.295
> rowVars(tmp5)
[1] 7887.82406 97.42973 62.37435 84.96404 76.24354 48.42225
[7] 54.26979 76.80864 83.96220 76.88797
> rowSd(tmp5)
[1] 88.813423 9.870650 7.897743 9.217594 8.731755 6.958609 7.366803
[8] 8.764054 9.163089 8.768578
> rowMax(tmp5)
[1] 468.23644 86.02304 88.41436 88.01967 84.69843 84.87257 81.62890
[8] 85.18975 85.40069 85.87409
> rowMin(tmp5)
[1] 53.70302 54.04428 60.55875 55.44367 57.32604 58.16519 55.84786 53.24535
[9] 55.51845 58.96958
>
> colMeans(tmp5)
[1] 109.72278 73.27610 70.72200 69.28529 73.81542 72.13106 70.41627
[8] 70.69842 69.27223 68.80358 72.21950 73.15315 68.97433 70.34816
[15] 66.62840 68.36226 73.80161 71.33589 66.51911 67.52811
> colSums(tmp5)
[1] 1097.2278 732.7610 707.2200 692.8529 738.1542 721.3106 704.1627
[8] 706.9842 692.7223 688.0358 722.1950 731.5315 689.7433 703.4816
[15] 666.2840 683.6226 738.0161 713.3589 665.1911 675.2811
> colVars(tmp5)
[1] 15912.41237 120.00234 47.38084 48.15926 81.93053 85.47797
[7] 80.69308 87.25947 58.62064 101.34503 61.65805 94.65472
[13] 94.99088 100.03610 49.76595 70.73652 73.21553 98.69696
[19] 67.28407 130.91288
> colSd(tmp5)
[1] 126.144411 10.954558 6.883374 6.939687 9.051549 9.245430
[7] 8.982933 9.341278 7.656412 10.067027 7.852264 9.729066
[13] 9.746326 10.001805 7.054498 8.410500 8.556608 9.934634
[19] 8.202687 11.441717
> colMax(tmp5)
[1] 468.23644 92.05687 81.39627 81.56036 84.81437 84.26020 85.18975
[8] 84.00460 85.40069 88.41436 83.35707 86.89308 83.79063 88.01967
[15] 77.16246 87.32883 86.02304 85.79161 82.30493 84.87257
> colMin(tmp5)
[1] 58.16519 60.32479 58.49897 60.04747 59.93445 58.34405 54.04428 59.33070
[9] 61.94380 57.32604 57.98227 58.41819 56.64763 55.84786 55.44367 58.91207
[17] 62.85843 57.62193 59.87122 53.24535
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 93.49945 69.81456 NA 70.77096 70.58299 71.47799 68.41159 66.72934
[9] 69.14219 70.66476
> rowSums(tmp5)
[1] 1869.989 1396.291 NA 1415.419 1411.660 1429.560 1368.232 1334.587
[9] 1382.844 1413.295
> rowVars(tmp5)
[1] 7887.82406 97.42973 62.97935 84.96404 76.24354 48.42225
[7] 54.26979 76.80864 83.96220 76.88797
> rowSd(tmp5)
[1] 88.813423 9.870650 7.935953 9.217594 8.731755 6.958609 7.366803
[8] 8.764054 9.163089 8.768578
> rowMax(tmp5)
[1] 468.23644 86.02304 NA 88.01967 84.69843 84.87257 81.62890
[8] 85.18975 85.40069 85.87409
> rowMin(tmp5)
[1] 53.70302 54.04428 NA 55.44367 57.32604 58.16519 55.84786 53.24535
[9] 55.51845 58.96958
>
> colMeans(tmp5)
[1] 109.72278 73.27610 70.72200 69.28529 73.81542 72.13106 70.41627
[8] 70.69842 69.27223 68.80358 72.21950 73.15315 68.97433 70.34816
[15] 66.62840 68.36226 73.80161 71.33589 66.51911 NA
> colSums(tmp5)
[1] 1097.2278 732.7610 707.2200 692.8529 738.1542 721.3106 704.1627
[8] 706.9842 692.7223 688.0358 722.1950 731.5315 689.7433 703.4816
[15] 666.2840 683.6226 738.0161 713.3589 665.1911 NA
> colVars(tmp5)
[1] 15912.41237 120.00234 47.38084 48.15926 81.93053 85.47797
[7] 80.69308 87.25947 58.62064 101.34503 61.65805 94.65472
[13] 94.99088 100.03610 49.76595 70.73652 73.21553 98.69696
[19] 67.28407 NA
> colSd(tmp5)
[1] 126.144411 10.954558 6.883374 6.939687 9.051549 9.245430
[7] 8.982933 9.341278 7.656412 10.067027 7.852264 9.729066
[13] 9.746326 10.001805 7.054498 8.410500 8.556608 9.934634
[19] 8.202687 NA
> colMax(tmp5)
[1] 468.23644 92.05687 81.39627 81.56036 84.81437 84.26020 85.18975
[8] 84.00460 85.40069 88.41436 83.35707 86.89308 83.79063 88.01967
[15] 77.16246 87.32883 86.02304 85.79161 82.30493 NA
> colMin(tmp5)
[1] 58.16519 60.32479 58.49897 60.04747 59.93445 58.34405 54.04428 59.33070
[9] 61.94380 57.32604 57.98227 58.41819 56.64763 55.84786 55.44367 58.91207
[17] 62.85843 57.62193 59.87122 NA
>
> Max(tmp5,na.rm=TRUE)
[1] 468.2364
> Min(tmp5,na.rm=TRUE)
[1] 53.24535
> mean(tmp5,na.rm=TRUE)
[1] 72.31523
> Sum(tmp5,na.rm=TRUE)
[1] 14390.73
> Var(tmp5,na.rm=TRUE)
[1] 872.6835
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 93.49945 69.81456 72.04494 70.77096 70.58299 71.47799 68.41159 66.72934
[9] 69.14219 70.66476
> rowSums(tmp5,na.rm=TRUE)
[1] 1869.989 1396.291 1368.854 1415.419 1411.660 1429.560 1368.232 1334.587
[9] 1382.844 1413.295
> rowVars(tmp5,na.rm=TRUE)
[1] 7887.82406 97.42973 62.97935 84.96404 76.24354 48.42225
[7] 54.26979 76.80864 83.96220 76.88797
> rowSd(tmp5,na.rm=TRUE)
[1] 88.813423 9.870650 7.935953 9.217594 8.731755 6.958609 7.366803
[8] 8.764054 9.163089 8.768578
> rowMax(tmp5,na.rm=TRUE)
[1] 468.23644 86.02304 88.41436 88.01967 84.69843 84.87257 81.62890
[8] 85.18975 85.40069 85.87409
> rowMin(tmp5,na.rm=TRUE)
[1] 53.70302 54.04428 60.55875 55.44367 57.32604 58.16519 55.84786 53.24535
[9] 55.51845 58.96958
>
> colMeans(tmp5,na.rm=TRUE)
[1] 109.72278 73.27610 70.72200 69.28529 73.81542 72.13106 70.41627
[8] 70.69842 69.27223 68.80358 72.21950 73.15315 68.97433 70.34816
[15] 66.62840 68.36226 73.80161 71.33589 66.51911 66.20828
> colSums(tmp5,na.rm=TRUE)
[1] 1097.2278 732.7610 707.2200 692.8529 738.1542 721.3106 704.1627
[8] 706.9842 692.7223 688.0358 722.1950 731.5315 689.7433 703.4816
[15] 666.2840 683.6226 738.0161 713.3589 665.1911 595.8745
> colVars(tmp5,na.rm=TRUE)
[1] 15912.41237 120.00234 47.38084 48.15926 81.93053 85.47797
[7] 80.69308 87.25947 58.62064 101.34503 61.65805 94.65472
[13] 94.99088 100.03610 49.76595 70.73652 73.21553 98.69696
[19] 67.28407 127.68001
> colSd(tmp5,na.rm=TRUE)
[1] 126.144411 10.954558 6.883374 6.939687 9.051549 9.245430
[7] 8.982933 9.341278 7.656412 10.067027 7.852264 9.729066
[13] 9.746326 10.001805 7.054498 8.410500 8.556608 9.934634
[19] 8.202687 11.299558
> colMax(tmp5,na.rm=TRUE)
[1] 468.23644 92.05687 81.39627 81.56036 84.81437 84.26020 85.18975
[8] 84.00460 85.40069 88.41436 83.35707 86.89308 83.79063 88.01967
[15] 77.16246 87.32883 86.02304 85.79161 82.30493 84.87257
> colMin(tmp5,na.rm=TRUE)
[1] 58.16519 60.32479 58.49897 60.04747 59.93445 58.34405 54.04428 59.33070
[9] 61.94380 57.32604 57.98227 58.41819 56.64763 55.84786 55.44367 58.91207
[17] 62.85843 57.62193 59.87122 53.24535
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 93.49945 69.81456 NaN 70.77096 70.58299 71.47799 68.41159 66.72934
[9] 69.14219 70.66476
> rowSums(tmp5,na.rm=TRUE)
[1] 1869.989 1396.291 0.000 1415.419 1411.660 1429.560 1368.232 1334.587
[9] 1382.844 1413.295
> rowVars(tmp5,na.rm=TRUE)
[1] 7887.82406 97.42973 NA 84.96404 76.24354 48.42225
[7] 54.26979 76.80864 83.96220 76.88797
> rowSd(tmp5,na.rm=TRUE)
[1] 88.813423 9.870650 NA 9.217594 8.731755 6.958609 7.366803
[8] 8.764054 9.163089 8.768578
> rowMax(tmp5,na.rm=TRUE)
[1] 468.23644 86.02304 NA 88.01967 84.69843 84.87257 81.62890
[8] 85.18975 85.40069 85.87409
> rowMin(tmp5,na.rm=TRUE)
[1] 53.70302 54.04428 NA 55.44367 57.32604 58.16519 55.84786 53.24535
[9] 55.51845 58.96958
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 114.35733 73.84427 71.28876 69.95119 72.96995 72.09847 69.30576
[8] 70.84548 69.90464 66.62461 71.85167 74.01846 67.79900 71.43587
[15] 66.47134 68.42233 73.66259 69.72970 66.08545 NaN
> colSums(tmp5,na.rm=TRUE)
[1] 1029.2160 664.5984 641.5989 629.5607 656.7296 648.8862 623.7518
[8] 637.6093 629.1418 599.6214 646.6650 666.1662 610.1910 642.9228
[15] 598.2421 615.8010 662.9633 627.5673 594.7691 0.0000
> colVars(tmp5,na.rm=TRUE)
[1] 17659.82493 131.37097 49.68966 49.19067 84.13013 96.15077
[7] 76.90575 97.92362 61.44876 60.59889 67.84321 98.06304
[13] 91.32383 99.23053 55.70916 79.53799 82.15005 82.01079
[19] 73.57891 NA
> colSd(tmp5,na.rm=TRUE)
[1] 132.890274 11.461718 7.049089 7.013606 9.172248 9.805650
[7] 8.769593 9.895637 7.838926 7.784529 8.236699 9.902678
[13] 9.556350 9.961452 7.463857 8.918407 9.063667 9.055981
[19] 8.577815 NA
> colMax(tmp5,na.rm=TRUE)
[1] 468.23644 92.05687 81.39627 81.56036 84.81437 84.26020 85.18975
[8] 84.00460 85.40069 82.49575 83.35707 86.89308 83.79063 88.01967
[15] 77.16246 87.32883 86.02304 83.35278 82.30493 -Inf
> colMin(tmp5,na.rm=TRUE)
[1] 58.16519 60.32479 58.49897 60.04747 59.93445 58.34405 54.04428 59.33070
[9] 61.94380 57.32604 57.98227 58.41819 56.64763 55.84786 55.44367 58.91207
[17] 62.85843 57.62193 59.87122 Inf
>
>
>
>
> 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] 306.8857 215.8004 213.5832 161.2185 246.1641 179.7129 255.4491 309.9776
[9] 313.1399 174.2091
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 306.8857 215.8004 213.5832 161.2185 246.1641 179.7129 255.4491 309.9776
[9] 313.1399 174.2091
>
>
>
> 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.705303e-13 -1.136868e-13 8.526513e-14 0.000000e+00
[6] 0.000000e+00 1.705303e-13 5.684342e-14 0.000000e+00 0.000000e+00
[11] -5.684342e-14 -1.136868e-13 5.684342e-14 -4.263256e-14 -5.684342e-14
[16] 1.421085e-13 -8.526513e-14 2.842171e-14 -1.705303e-13 5.684342e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
6 9
4 9
10 19
8 3
2 8
8 15
4 3
6 7
6 18
3 16
2 20
6 5
10 2
5 9
8 7
9 16
7 20
10 3
8 14
9 20
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.012143
> Min(tmp)
[1] -3.31436
> mean(tmp)
[1] -0.09903564
> Sum(tmp)
[1] -9.903564
> Var(tmp)
[1] 0.8787463
>
> rowMeans(tmp)
[1] -0.09903564
> rowSums(tmp)
[1] -9.903564
> rowVars(tmp)
[1] 0.8787463
> rowSd(tmp)
[1] 0.9374147
> rowMax(tmp)
[1] 2.012143
> rowMin(tmp)
[1] -3.31436
>
> colMeans(tmp)
[1] 0.782430105 -0.021490130 -1.055961014 -0.234379940 -0.407409768
[6] 0.123783245 -0.850660116 0.229247220 1.734744155 0.006384173
[11] 0.124455071 -0.955553474 -0.802893766 -0.094722950 1.390146773
[16] -0.113561316 -0.098916494 -0.148095321 1.468107326 -1.504049553
[21] 0.619407401 1.117300064 -0.455838300 0.621097016 1.609499103
[26] -1.098223812 0.714549836 0.275814916 0.351358707 -1.064792260
[31] -0.074663394 0.824752595 -0.696068027 -0.788787699 0.675663511
[36] -0.638183858 0.102016798 -0.552304627 -0.793002706 0.801997280
[41] 0.879653562 -3.314360028 -0.878400578 -1.160989063 -0.501078043
[46] -1.220701912 0.955145576 -0.432040461 0.367223472 1.293695291
[51] -0.688809924 -0.185439923 0.123909257 0.220864765 -0.833858020
[56] 0.939920153 -1.656822343 -0.380067849 -1.804045851 -0.996732231
[61] -1.381695096 0.694171497 -1.557531661 0.365055901 -0.060613101
[66] -0.885028450 0.441954283 -0.275839146 -0.907061492 -0.342633968
[71] -1.126706026 -1.443509048 0.345173299 -1.236740400 0.048913182
[76] 0.947372550 0.215074463 0.227991797 0.767075920 -0.127761351
[81] -0.095762657 0.210014982 -1.291759967 -0.569141298 -0.737516070
[86] -1.176322229 -0.834759569 1.378052046 -0.483932318 -0.504206140
[91] 1.223976681 1.025408126 -1.335199001 0.293851625 0.191966880
[96] 1.024957603 0.933751219 2.012143050 0.543515735 1.729471304
> colSums(tmp)
[1] 0.782430105 -0.021490130 -1.055961014 -0.234379940 -0.407409768
[6] 0.123783245 -0.850660116 0.229247220 1.734744155 0.006384173
[11] 0.124455071 -0.955553474 -0.802893766 -0.094722950 1.390146773
[16] -0.113561316 -0.098916494 -0.148095321 1.468107326 -1.504049553
[21] 0.619407401 1.117300064 -0.455838300 0.621097016 1.609499103
[26] -1.098223812 0.714549836 0.275814916 0.351358707 -1.064792260
[31] -0.074663394 0.824752595 -0.696068027 -0.788787699 0.675663511
[36] -0.638183858 0.102016798 -0.552304627 -0.793002706 0.801997280
[41] 0.879653562 -3.314360028 -0.878400578 -1.160989063 -0.501078043
[46] -1.220701912 0.955145576 -0.432040461 0.367223472 1.293695291
[51] -0.688809924 -0.185439923 0.123909257 0.220864765 -0.833858020
[56] 0.939920153 -1.656822343 -0.380067849 -1.804045851 -0.996732231
[61] -1.381695096 0.694171497 -1.557531661 0.365055901 -0.060613101
[66] -0.885028450 0.441954283 -0.275839146 -0.907061492 -0.342633968
[71] -1.126706026 -1.443509048 0.345173299 -1.236740400 0.048913182
[76] 0.947372550 0.215074463 0.227991797 0.767075920 -0.127761351
[81] -0.095762657 0.210014982 -1.291759967 -0.569141298 -0.737516070
[86] -1.176322229 -0.834759569 1.378052046 -0.483932318 -0.504206140
[91] 1.223976681 1.025408126 -1.335199001 0.293851625 0.191966880
[96] 1.024957603 0.933751219 2.012143050 0.543515735 1.729471304
> 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.782430105 -0.021490130 -1.055961014 -0.234379940 -0.407409768
[6] 0.123783245 -0.850660116 0.229247220 1.734744155 0.006384173
[11] 0.124455071 -0.955553474 -0.802893766 -0.094722950 1.390146773
[16] -0.113561316 -0.098916494 -0.148095321 1.468107326 -1.504049553
[21] 0.619407401 1.117300064 -0.455838300 0.621097016 1.609499103
[26] -1.098223812 0.714549836 0.275814916 0.351358707 -1.064792260
[31] -0.074663394 0.824752595 -0.696068027 -0.788787699 0.675663511
[36] -0.638183858 0.102016798 -0.552304627 -0.793002706 0.801997280
[41] 0.879653562 -3.314360028 -0.878400578 -1.160989063 -0.501078043
[46] -1.220701912 0.955145576 -0.432040461 0.367223472 1.293695291
[51] -0.688809924 -0.185439923 0.123909257 0.220864765 -0.833858020
[56] 0.939920153 -1.656822343 -0.380067849 -1.804045851 -0.996732231
[61] -1.381695096 0.694171497 -1.557531661 0.365055901 -0.060613101
[66] -0.885028450 0.441954283 -0.275839146 -0.907061492 -0.342633968
[71] -1.126706026 -1.443509048 0.345173299 -1.236740400 0.048913182
[76] 0.947372550 0.215074463 0.227991797 0.767075920 -0.127761351
[81] -0.095762657 0.210014982 -1.291759967 -0.569141298 -0.737516070
[86] -1.176322229 -0.834759569 1.378052046 -0.483932318 -0.504206140
[91] 1.223976681 1.025408126 -1.335199001 0.293851625 0.191966880
[96] 1.024957603 0.933751219 2.012143050 0.543515735 1.729471304
> colMin(tmp)
[1] 0.782430105 -0.021490130 -1.055961014 -0.234379940 -0.407409768
[6] 0.123783245 -0.850660116 0.229247220 1.734744155 0.006384173
[11] 0.124455071 -0.955553474 -0.802893766 -0.094722950 1.390146773
[16] -0.113561316 -0.098916494 -0.148095321 1.468107326 -1.504049553
[21] 0.619407401 1.117300064 -0.455838300 0.621097016 1.609499103
[26] -1.098223812 0.714549836 0.275814916 0.351358707 -1.064792260
[31] -0.074663394 0.824752595 -0.696068027 -0.788787699 0.675663511
[36] -0.638183858 0.102016798 -0.552304627 -0.793002706 0.801997280
[41] 0.879653562 -3.314360028 -0.878400578 -1.160989063 -0.501078043
[46] -1.220701912 0.955145576 -0.432040461 0.367223472 1.293695291
[51] -0.688809924 -0.185439923 0.123909257 0.220864765 -0.833858020
[56] 0.939920153 -1.656822343 -0.380067849 -1.804045851 -0.996732231
[61] -1.381695096 0.694171497 -1.557531661 0.365055901 -0.060613101
[66] -0.885028450 0.441954283 -0.275839146 -0.907061492 -0.342633968
[71] -1.126706026 -1.443509048 0.345173299 -1.236740400 0.048913182
[76] 0.947372550 0.215074463 0.227991797 0.767075920 -0.127761351
[81] -0.095762657 0.210014982 -1.291759967 -0.569141298 -0.737516070
[86] -1.176322229 -0.834759569 1.378052046 -0.483932318 -0.504206140
[91] 1.223976681 1.025408126 -1.335199001 0.293851625 0.191966880
[96] 1.024957603 0.933751219 2.012143050 0.543515735 1.729471304
> colMedians(tmp)
[1] 0.782430105 -0.021490130 -1.055961014 -0.234379940 -0.407409768
[6] 0.123783245 -0.850660116 0.229247220 1.734744155 0.006384173
[11] 0.124455071 -0.955553474 -0.802893766 -0.094722950 1.390146773
[16] -0.113561316 -0.098916494 -0.148095321 1.468107326 -1.504049553
[21] 0.619407401 1.117300064 -0.455838300 0.621097016 1.609499103
[26] -1.098223812 0.714549836 0.275814916 0.351358707 -1.064792260
[31] -0.074663394 0.824752595 -0.696068027 -0.788787699 0.675663511
[36] -0.638183858 0.102016798 -0.552304627 -0.793002706 0.801997280
[41] 0.879653562 -3.314360028 -0.878400578 -1.160989063 -0.501078043
[46] -1.220701912 0.955145576 -0.432040461 0.367223472 1.293695291
[51] -0.688809924 -0.185439923 0.123909257 0.220864765 -0.833858020
[56] 0.939920153 -1.656822343 -0.380067849 -1.804045851 -0.996732231
[61] -1.381695096 0.694171497 -1.557531661 0.365055901 -0.060613101
[66] -0.885028450 0.441954283 -0.275839146 -0.907061492 -0.342633968
[71] -1.126706026 -1.443509048 0.345173299 -1.236740400 0.048913182
[76] 0.947372550 0.215074463 0.227991797 0.767075920 -0.127761351
[81] -0.095762657 0.210014982 -1.291759967 -0.569141298 -0.737516070
[86] -1.176322229 -0.834759569 1.378052046 -0.483932318 -0.504206140
[91] 1.223976681 1.025408126 -1.335199001 0.293851625 0.191966880
[96] 1.024957603 0.933751219 2.012143050 0.543515735 1.729471304
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.7824301 -0.02149013 -1.055961 -0.2343799 -0.4074098 0.1237832 -0.8506601
[2,] 0.7824301 -0.02149013 -1.055961 -0.2343799 -0.4074098 0.1237832 -0.8506601
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.2292472 1.734744 0.006384173 0.1244551 -0.9555535 -0.8028938 -0.09472295
[2,] 0.2292472 1.734744 0.006384173 0.1244551 -0.9555535 -0.8028938 -0.09472295
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 1.390147 -0.1135613 -0.09891649 -0.1480953 1.468107 -1.50405 0.6194074
[2,] 1.390147 -0.1135613 -0.09891649 -0.1480953 1.468107 -1.50405 0.6194074
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 1.1173 -0.4558383 0.621097 1.609499 -1.098224 0.7145498 0.2758149
[2,] 1.1173 -0.4558383 0.621097 1.609499 -1.098224 0.7145498 0.2758149
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.3513587 -1.064792 -0.07466339 0.8247526 -0.696068 -0.7887877 0.6756635
[2,] 0.3513587 -1.064792 -0.07466339 0.8247526 -0.696068 -0.7887877 0.6756635
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.6381839 0.1020168 -0.5523046 -0.7930027 0.8019973 0.8796536 -3.31436
[2,] -0.6381839 0.1020168 -0.5523046 -0.7930027 0.8019973 0.8796536 -3.31436
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.8784006 -1.160989 -0.501078 -1.220702 0.9551456 -0.4320405 0.3672235
[2,] -0.8784006 -1.160989 -0.501078 -1.220702 0.9551456 -0.4320405 0.3672235
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 1.293695 -0.6888099 -0.1854399 0.1239093 0.2208648 -0.833858 0.9399202
[2,] 1.293695 -0.6888099 -0.1854399 0.1239093 0.2208648 -0.833858 0.9399202
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -1.656822 -0.3800678 -1.804046 -0.9967322 -1.381695 0.6941715 -1.557532
[2,] -1.656822 -0.3800678 -1.804046 -0.9967322 -1.381695 0.6941715 -1.557532
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.3650559 -0.0606131 -0.8850285 0.4419543 -0.2758391 -0.9070615 -0.342634
[2,] 0.3650559 -0.0606131 -0.8850285 0.4419543 -0.2758391 -0.9070615 -0.342634
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -1.126706 -1.443509 0.3451733 -1.23674 0.04891318 0.9473725 0.2150745
[2,] -1.126706 -1.443509 0.3451733 -1.23674 0.04891318 0.9473725 0.2150745
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.2279918 0.7670759 -0.1277614 -0.09576266 0.210015 -1.29176 -0.5691413
[2,] 0.2279918 0.7670759 -0.1277614 -0.09576266 0.210015 -1.29176 -0.5691413
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.7375161 -1.176322 -0.8347596 1.378052 -0.4839323 -0.5042061 1.223977
[2,] -0.7375161 -1.176322 -0.8347596 1.378052 -0.4839323 -0.5042061 1.223977
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 1.025408 -1.335199 0.2938516 0.1919669 1.024958 0.9337512 2.012143
[2,] 1.025408 -1.335199 0.2938516 0.1919669 1.024958 0.9337512 2.012143
[,99] [,100]
[1,] 0.5435157 1.729471
[2,] 0.5435157 1.729471
>
>
> Max(tmp2)
[1] 3.03977
> Min(tmp2)
[1] -2.760177
> mean(tmp2)
[1] 0.06698753
> Sum(tmp2)
[1] 6.698753
> Var(tmp2)
[1] 0.9715204
>
> rowMeans(tmp2)
[1] -1.9906030359 -0.8819172574 -0.3648958239 -0.0006886623 -0.1841766933
[6] 0.7445886355 1.2486399687 -1.1192623953 0.6717003091 0.4332147974
[11] -0.4847762422 -1.7679240630 1.1989723725 -0.1245651636 0.8227013346
[16] -1.1450571853 -0.7952553911 0.1288785191 2.3270027672 -1.7071541398
[21] 0.2769113964 -0.2293240200 1.5826278587 -0.6865355975 -0.9427007595
[26] 0.2713131712 1.5878759675 0.1175053608 0.0451371953 0.4114550927
[31] 1.4807277476 0.2326430286 0.5022477615 -0.3954895658 -2.7601767316
[36] 1.2373971693 -0.6282610810 -0.1827298427 0.5803205996 0.4894617331
[41] 0.0866068352 0.0603659238 -1.2854266725 0.9921051697 -0.2475604387
[46] 0.6400304674 0.6140520332 0.6157914490 -0.5433043300 -1.5179284648
[51] -0.6712431668 -0.7151211556 0.1471789272 0.4938934253 1.0466565501
[56] -1.1061750009 1.1434213325 -0.0971742653 0.2663338923 -0.0310319936
[61] -0.5229418171 0.3639598789 -1.1170597945 0.1252607647 0.3417783921
[66] 1.3274459806 0.8292525809 -0.5425620365 1.3107111801 3.0397699360
[71] -0.7738411140 0.6657571787 -0.3931396248 -0.7544564345 -0.1330246686
[76] 0.5895622223 -1.5287788963 -0.2688180480 0.9028073538 1.8254622719
[81] 0.6586340824 0.1802096690 0.3810524568 1.5239192169 -0.4333873972
[86] -0.9713027310 1.3158064942 -1.9484688019 1.5440459539 -1.5108065307
[91] 0.2266011191 0.2014492076 -0.9304357272 0.3104933024 -0.6289951226
[96] 0.8869492868 -0.0991035948 0.3625456770 0.3442355125 0.1068656724
> rowSums(tmp2)
[1] -1.9906030359 -0.8819172574 -0.3648958239 -0.0006886623 -0.1841766933
[6] 0.7445886355 1.2486399687 -1.1192623953 0.6717003091 0.4332147974
[11] -0.4847762422 -1.7679240630 1.1989723725 -0.1245651636 0.8227013346
[16] -1.1450571853 -0.7952553911 0.1288785191 2.3270027672 -1.7071541398
[21] 0.2769113964 -0.2293240200 1.5826278587 -0.6865355975 -0.9427007595
[26] 0.2713131712 1.5878759675 0.1175053608 0.0451371953 0.4114550927
[31] 1.4807277476 0.2326430286 0.5022477615 -0.3954895658 -2.7601767316
[36] 1.2373971693 -0.6282610810 -0.1827298427 0.5803205996 0.4894617331
[41] 0.0866068352 0.0603659238 -1.2854266725 0.9921051697 -0.2475604387
[46] 0.6400304674 0.6140520332 0.6157914490 -0.5433043300 -1.5179284648
[51] -0.6712431668 -0.7151211556 0.1471789272 0.4938934253 1.0466565501
[56] -1.1061750009 1.1434213325 -0.0971742653 0.2663338923 -0.0310319936
[61] -0.5229418171 0.3639598789 -1.1170597945 0.1252607647 0.3417783921
[66] 1.3274459806 0.8292525809 -0.5425620365 1.3107111801 3.0397699360
[71] -0.7738411140 0.6657571787 -0.3931396248 -0.7544564345 -0.1330246686
[76] 0.5895622223 -1.5287788963 -0.2688180480 0.9028073538 1.8254622719
[81] 0.6586340824 0.1802096690 0.3810524568 1.5239192169 -0.4333873972
[86] -0.9713027310 1.3158064942 -1.9484688019 1.5440459539 -1.5108065307
[91] 0.2266011191 0.2014492076 -0.9304357272 0.3104933024 -0.6289951226
[96] 0.8869492868 -0.0991035948 0.3625456770 0.3442355125 0.1068656724
> 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.9906030359 -0.8819172574 -0.3648958239 -0.0006886623 -0.1841766933
[6] 0.7445886355 1.2486399687 -1.1192623953 0.6717003091 0.4332147974
[11] -0.4847762422 -1.7679240630 1.1989723725 -0.1245651636 0.8227013346
[16] -1.1450571853 -0.7952553911 0.1288785191 2.3270027672 -1.7071541398
[21] 0.2769113964 -0.2293240200 1.5826278587 -0.6865355975 -0.9427007595
[26] 0.2713131712 1.5878759675 0.1175053608 0.0451371953 0.4114550927
[31] 1.4807277476 0.2326430286 0.5022477615 -0.3954895658 -2.7601767316
[36] 1.2373971693 -0.6282610810 -0.1827298427 0.5803205996 0.4894617331
[41] 0.0866068352 0.0603659238 -1.2854266725 0.9921051697 -0.2475604387
[46] 0.6400304674 0.6140520332 0.6157914490 -0.5433043300 -1.5179284648
[51] -0.6712431668 -0.7151211556 0.1471789272 0.4938934253 1.0466565501
[56] -1.1061750009 1.1434213325 -0.0971742653 0.2663338923 -0.0310319936
[61] -0.5229418171 0.3639598789 -1.1170597945 0.1252607647 0.3417783921
[66] 1.3274459806 0.8292525809 -0.5425620365 1.3107111801 3.0397699360
[71] -0.7738411140 0.6657571787 -0.3931396248 -0.7544564345 -0.1330246686
[76] 0.5895622223 -1.5287788963 -0.2688180480 0.9028073538 1.8254622719
[81] 0.6586340824 0.1802096690 0.3810524568 1.5239192169 -0.4333873972
[86] -0.9713027310 1.3158064942 -1.9484688019 1.5440459539 -1.5108065307
[91] 0.2266011191 0.2014492076 -0.9304357272 0.3104933024 -0.6289951226
[96] 0.8869492868 -0.0991035948 0.3625456770 0.3442355125 0.1068656724
> rowMin(tmp2)
[1] -1.9906030359 -0.8819172574 -0.3648958239 -0.0006886623 -0.1841766933
[6] 0.7445886355 1.2486399687 -1.1192623953 0.6717003091 0.4332147974
[11] -0.4847762422 -1.7679240630 1.1989723725 -0.1245651636 0.8227013346
[16] -1.1450571853 -0.7952553911 0.1288785191 2.3270027672 -1.7071541398
[21] 0.2769113964 -0.2293240200 1.5826278587 -0.6865355975 -0.9427007595
[26] 0.2713131712 1.5878759675 0.1175053608 0.0451371953 0.4114550927
[31] 1.4807277476 0.2326430286 0.5022477615 -0.3954895658 -2.7601767316
[36] 1.2373971693 -0.6282610810 -0.1827298427 0.5803205996 0.4894617331
[41] 0.0866068352 0.0603659238 -1.2854266725 0.9921051697 -0.2475604387
[46] 0.6400304674 0.6140520332 0.6157914490 -0.5433043300 -1.5179284648
[51] -0.6712431668 -0.7151211556 0.1471789272 0.4938934253 1.0466565501
[56] -1.1061750009 1.1434213325 -0.0971742653 0.2663338923 -0.0310319936
[61] -0.5229418171 0.3639598789 -1.1170597945 0.1252607647 0.3417783921
[66] 1.3274459806 0.8292525809 -0.5425620365 1.3107111801 3.0397699360
[71] -0.7738411140 0.6657571787 -0.3931396248 -0.7544564345 -0.1330246686
[76] 0.5895622223 -1.5287788963 -0.2688180480 0.9028073538 1.8254622719
[81] 0.6586340824 0.1802096690 0.3810524568 1.5239192169 -0.4333873972
[86] -0.9713027310 1.3158064942 -1.9484688019 1.5440459539 -1.5108065307
[91] 0.2266011191 0.2014492076 -0.9304357272 0.3104933024 -0.6289951226
[96] 0.8869492868 -0.0991035948 0.3625456770 0.3442355125 0.1068656724
>
> colMeans(tmp2)
[1] 0.06698753
> colSums(tmp2)
[1] 6.698753
> colVars(tmp2)
[1] 0.9715204
> colSd(tmp2)
[1] 0.9856573
> colMax(tmp2)
[1] 3.03977
> colMin(tmp2)
[1] -2.760177
> colMedians(tmp2)
[1] 0.1270696
> colRanges(tmp2)
[,1]
[1,] -2.760177
[2,] 3.039770
>
> 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] -0.1000087 -2.7406046 2.7615390 3.3943084 -5.8985058 4.9272239
[7] -2.7487928 2.9989326 -3.7093859 -1.6029001
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.7698616
[2,] -0.5416119
[3,] -0.3532657
[4,] 0.1088679
[5,] 1.6319108
>
> rowApply(tmp,sum)
[1] -6.9567943 0.3999137 4.0952010 0.5320638 -0.2187732 -1.8898144
[7] -1.2888943 1.2222747 1.7989091 -0.4122800
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 7 4 8 5 4 8 4 3 2 10
[2,] 9 2 1 4 5 6 5 8 8 3
[3,] 2 10 10 2 1 7 9 9 4 4
[4,] 10 7 2 9 8 9 8 5 1 6
[5,] 1 5 9 7 6 1 1 2 5 8
[6,] 8 6 5 6 9 10 6 7 9 7
[7,] 6 3 6 8 2 4 3 4 10 1
[8,] 4 9 7 1 10 3 2 10 6 9
[9,] 3 8 4 3 3 5 7 1 3 2
[10,] 5 1 3 10 7 2 10 6 7 5
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 2.02290185 -1.29217292 3.03731269 -1.13352257 -1.49761114 -1.85524486
[7] 1.35305746 2.77673000 -0.11851317 -1.50638188 3.10035655 1.20114273
[13] 3.22563040 0.72578653 0.33163873 0.53158617 3.10270701 0.77261477
[19] 2.08452523 -0.08069059
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.78337217
[2,] 0.06518919
[3,] 0.36746042
[4,] 0.86126601
[5,] 1.51235841
>
> rowApply(tmp,sum)
[1] 8.296447 -2.367829 6.976400 5.571599 -1.694765
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 3 15 6 19 16
[2,] 1 8 11 3 17
[3,] 15 2 14 20 13
[4,] 14 3 13 6 2
[5,] 4 20 2 8 3
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.78337217 -1.4023250 1.1359280 0.9968076 -0.67432183 1.5850781
[2,] 0.36746042 -0.6191621 -1.1869477 -1.0662687 1.91177517 -0.1909731
[3,] 0.06518919 0.5441206 0.7782753 0.6862838 -1.54671966 -1.9630640
[4,] 1.51235841 -0.7334192 2.1623564 -0.1987924 -0.04080931 -0.1846986
[5,] 0.86126601 0.9186128 0.1477007 -1.5515529 -1.14753551 -1.1015872
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.5603005 1.27543636 -1.11891289 -0.4893416 0.01756994 0.1995950
[2,] 1.1087778 -0.68379176 -0.14651599 0.2475547 0.45644903 -0.7689416
[3,] -0.4627325 1.51874958 0.68052320 1.4720038 0.18160321 1.3575110
[4,] -0.6094963 0.62810143 0.08057931 -1.7264578 1.33988254 -0.7240381
[5,] 0.7562080 0.03823438 0.38581320 -1.0101410 1.10485184 1.1370164
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.1660217 1.6621562 0.3683620 0.03195992 2.5303790 2.6090680
[2,] -0.9856417 -1.5179540 0.3296141 -0.09538032 1.0797597 -0.7297524
[3,] 1.7317283 -0.3483853 -0.8387590 0.19929695 1.4005642 0.2410392
[4,] 0.9016205 1.1029807 0.8877875 0.99565496 -1.7322573 0.6911171
[5,] 1.7439450 -0.1730111 -0.4153659 -0.59994534 -0.1757386 -2.0388571
[,19] [,20]
[1,] 0.2798772 -0.3217751
[2,] 0.6837823 -0.5616731
[3,] 0.8315866 0.4475858
[4,] 0.6248448 0.5942844
[5,] -0.3355657 -0.2391127
>
>
> 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.24-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.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 654 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 565 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-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.09227452 0.7879154 -0.5262393 0.9330197 -0.2517301 -0.7189955 2.626692
col8 col9 col10 col11 col12 col13 col14
row1 0.12776 -0.3888365 -0.3827348 -1.98553 -0.3501556 -0.2138018 -0.8085581
col15 col16 col17 col18 col19 col20
row1 -1.121313 1.877431 1.113803 -0.005973859 -0.9049242 -0.01793557
> tmp[,"col10"]
col10
row1 -0.3827348
row2 0.2108978
row3 -1.6907717
row4 -0.6661966
row5 -1.7290045
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -0.09227452 0.7879154 -0.5262393 0.9330197 -0.2517301 -0.7189955
row5 0.78071067 -0.7225858 -1.6726614 -0.5176999 2.3476222 1.3830095
col7 col8 col9 col10 col11 col12
row1 2.626692 0.127760 -0.38883654 -0.3827348 -1.98552966 -0.3501556
row5 -2.289992 1.440586 0.03907599 -1.7290045 0.09307444 -0.3568367
col13 col14 col15 col16 col17 col18
row1 -0.2138018 -0.8085581 -1.1213134 1.877431 1.1138029 -0.005973859
row5 0.2425778 0.5137246 0.7695613 1.724614 0.1071226 -1.399853114
col19 col20
row1 -0.9049242 -0.01793557
row5 0.1130627 0.19413915
> tmp[,c("col6","col20")]
col6 col20
row1 -0.7189955 -0.01793557
row2 -0.3479566 0.23451820
row3 -1.5952283 -1.03967158
row4 1.1713029 0.72106322
row5 1.3830095 0.19413915
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.7189955 -0.01793557
row5 1.3830095 0.19413915
>
>
>
>
> 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.292 50.59223 51.04307 49.74408 48.87714 104.9866 50.23473 50.82632
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.4443 50.58946 49.75609 48.81035 49.44518 50.11325 48.1262 50.10683
col17 col18 col19 col20
row1 51.18991 50.03098 50.03582 105.7412
> tmp[,"col10"]
col10
row1 50.58946
row2 28.49184
row3 29.54631
row4 31.67961
row5 48.43503
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.29200 50.59223 51.04307 49.74408 48.87714 104.9866 50.23473 50.82632
row5 48.37517 49.59031 49.63548 51.94194 50.29531 103.9871 49.78422 50.64148
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.44430 50.58946 49.75609 48.81035 49.44518 50.11325 48.12620 50.10683
row5 49.61064 48.43503 49.86263 51.01690 49.60628 51.06586 50.93785 50.90507
col17 col18 col19 col20
row1 51.18991 50.03098 50.03582 105.7412
row5 52.01344 50.69969 51.91825 103.9538
> tmp[,c("col6","col20")]
col6 col20
row1 104.98662 105.74123
row2 76.19287 71.90927
row3 74.89495 74.81132
row4 75.35449 74.98301
row5 103.98707 103.95383
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.9866 105.7412
row5 103.9871 103.9538
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.9866 105.7412
row5 103.9871 103.9538
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.9165714
[2,] 0.4541965
[3,] -1.1363228
[4,] -0.4171723
[5,] -0.3823618
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.4901056 -0.1588650
[2,] 1.5387288 0.1553592
[3,] -1.1803808 -0.6608218
[4,] -0.9755126 1.0869369
[5,] -1.8993477 1.0098037
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.2629766 0.02826949
[2,] 0.4775812 0.78730264
[3,] -1.6307932 -0.16272995
[4,] 0.5561126 0.77635889
[5,] -0.2488681 0.58460836
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.2629766
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.2629766
[2,] 0.4775812
>
>
>
> 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.3201407 0.4495133 -0.7362092 -0.3399903 -0.07349295 2.295386 0.5972090
row1 0.6028357 1.0344203 0.2936455 -0.3733569 1.94299947 1.670169 0.2384875
[,8] [,9] [,10] [,11] [,12] [,13]
row3 -0.3116328 -1.0065435 -0.9708997 0.8447763 -0.25250980 -0.5997299
row1 -1.1698090 0.4212132 -0.4203438 0.9212165 0.02200708 0.1852191
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row3 0.1129368 0.7486372 -0.5269950 -0.1829678 1.6968204 -1.493423 -0.4303787
row1 -0.9467207 -0.6962383 -0.8446126 -1.2869184 0.5097872 -2.057231 1.7545908
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.6830429 0.1239906 -0.2630534 0.7687151 1.584861 -2.636456 -1.109999
[,8] [,9] [,10]
row2 0.8782564 -1.577732 -0.1516889
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.3547106 2.353537 0.909339 0.2422915 -1.077431 0.03053873 -1.074246
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.8193489 1.842043 1.345987 -0.8939743 -0.07586389 -2.374563 0.1429548
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.7951655 0.4063024 -0.8010047 0.2967463 0.6422284 -0.5936521
>
>
> 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: 0x62fd95c69d20>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM34bd8758715f83"
[2] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM34bd872fefa223"
[3] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM34bd87310a81e6"
[4] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM34bd87aa0e6bd"
[5] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM34bd873c92bfef"
[6] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM34bd877cde2dd2"
[7] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM34bd87372e55d1"
[8] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM34bd87521f37ed"
[9] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM34bd876094be50"
[10] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM34bd875e335e6e"
[11] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM34bd87138d1044"
[12] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM34bd87290abc09"
[13] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM34bd8773719f41"
[14] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM34bd8769659dde"
[15] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM34bd8773789f01"
>
>
> ### 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: 0x62fd964c05f0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x62fd964c05f0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x62fd964c05f0>
> rowMedians(tmp)
[1] -0.322022379 0.008358875 0.345526308 0.082391778 -0.231343496
[6] 0.167346740 0.546984297 0.050405974 0.164562376 0.081092285
[11] 0.086597571 -1.004075996 -0.233683905 0.167851451 -0.103587243
[16] 0.211088922 0.085455015 -0.009045199 -0.518194445 -0.572484989
[21] 0.477671168 0.478112138 0.324442119 0.044199846 -0.052481498
[26] 0.031385066 0.486919155 -0.069566366 -0.044713475 0.475708356
[31] 0.269340087 -0.210203727 0.239496240 0.324850087 0.363820695
[36] 0.413821363 -0.092167136 0.207870507 -0.217353472 0.529779733
[41] -0.173142872 -0.109022923 -0.732485338 -0.204080511 0.285907691
[46] 0.366313672 0.141800446 -0.211159724 0.691199130 0.234447414
[51] -0.257893287 0.194083032 0.335639505 -0.401203300 -0.206736506
[56] -0.113418079 0.270707939 0.352317755 0.174077448 -0.089291144
[61] 0.091200295 -0.034133772 -0.142082904 0.457224085 0.108662795
[66] -0.708656752 -0.033068312 0.356861620 -0.118272009 0.493751183
[71] -0.237722856 -0.224356172 -0.115066029 0.237874355 0.584171224
[76] 0.103519621 -0.022278385 -0.241720183 0.219740739 0.054583674
[81] -0.355655627 -0.362373525 0.100857058 -0.404889293 0.322562342
[86] 0.387190131 -0.130285002 -0.226062978 -0.047430912 0.031066767
[91] 0.005673153 -0.063762279 -0.413996831 -0.014472857 0.184342544
[96] -0.121930651 -0.622179635 0.285704450 -0.011330711 -0.435410722
[101] 0.590256659 -0.367751617 0.335175926 -0.269552421 0.829082099
[106] -0.143488521 -0.335700675 0.019409597 -0.114041766 0.017843949
[111] 0.039139041 0.419312518 -0.089697822 0.071061068 0.217252178
[116] 0.267055710 -0.185721696 -0.039009998 0.004485587 0.217258405
[121] 0.643407677 0.036144684 0.112826827 0.369670392 -0.045701505
[126] -0.300706391 0.058884547 -0.034282671 0.230623128 -0.047541647
[131] -0.392940398 -0.120086320 0.274106989 -0.114633104 0.380505586
[136] -0.194327080 0.243907481 -0.586752218 -0.225051972 -0.134868352
[141] 0.237917787 0.336467150 -0.523107124 -0.092621753 -0.673240882
[146] -0.520096418 -0.124506692 0.302109799 0.194628637 -0.169566487
[151] -0.193922330 0.836034724 -0.192548473 0.334071271 -0.222336273
[156] 0.115250919 0.201511440 -0.148084782 -0.335021815 0.230450015
[161] 0.118481565 -0.535522615 -0.023254414 -0.630064225 0.044906682
[166] 0.600847433 -0.173002106 -0.158779737 -0.051757927 -0.183993537
[171] -0.056109611 0.062651229 -0.415081561 0.131232715 -0.455825087
[176] -0.459590319 0.507637037 -0.600686184 -0.067436905 -0.394852349
[181] -0.379626553 -0.755224967 0.048589410 0.059657215 0.581786473
[186] 0.006108255 -0.224400021 -0.508253296 0.450493327 0.011492141
[191] 0.123788321 -0.063349158 -0.179343335 0.182507755 -0.353309358
[196] -0.003525072 -0.320946937 0.258118251 0.189856292 0.106653807
[201] -0.148730008 0.506124505 -0.073873291 -0.002665731 0.163001885
[206] 0.492660138 0.058885025 0.330621791 -0.205145910 0.038635986
[211] 0.019700207 0.054795036 -0.095958855 -0.062114855 0.021551046
[216] 0.432342954 0.045256951 -0.033634499 0.494263749 0.238570618
[221] 0.101839559 0.342778622 0.395284098 -0.082598954 0.021439490
[226] 0.329374064 0.509446353 0.021634696 -0.176264854 -0.146031134
>
> proc.time()
user system elapsed
1.309 0.683 1.981
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 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: 0x62916b1b1520>
> .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: 0x62916b1b1520>
> .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: 0x62916b1b1520>
> .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: 0x62916b1b1520>
> 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: 0x62916ad5af60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62916ad5af60>
> .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: 0x62916ad5af60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62916ad5af60>
> .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: 0x62916ad5af60>
> 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: 0x62916b904b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62916b904b40>
> .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: 0x62916b904b40>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x62916b904b40>
> .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: 0x62916b904b40>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x62916b904b40>
> .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: 0x62916b904b40>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x62916b904b40>
> .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: 0x62916b904b40>
> 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: 0x62916b941bc0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x62916b941bc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62916b941bc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62916b941bc0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile34be1e243e388e" "BufferedMatrixFile34be1e6bd24c56"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile34be1e243e388e" "BufferedMatrixFile34be1e6bd24c56"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x62916b8db000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62916b8db000>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x62916b8db000>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x62916b8db000>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x62916b8db000>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x62916b8db000>
> .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: 0x62916aa0ee30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62916aa0ee30>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x62916aa0ee30>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x62916aa0ee30>
> 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: 0x62916b038a50>
> .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: 0x62916b038a50>
> rm(P)
>
> proc.time()
user system elapsed
0.256 0.051 0.295
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 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.247 0.044 0.281