| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-05-06 11:35 -0400 (Wed, 06 May 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.4 LTS) | x86_64 | 4.6.0 RC (2026-04-17 r89917) -- "Because it was There" | 4989 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.6.0 Patched (2026-04-24 r89963) -- "Because it was There" | 4722 |
| 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 262/2418 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.76.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.4 LTS) / x86_64 | OK | OK | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
| See other builds for BufferedMatrix in R Universe. | ||||||||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.76.0 |
| Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.76.0.tar.gz |
| StartedAt: 2026-05-05 21:59:13 -0400 (Tue, 05 May 2026) |
| EndedAt: 2026-05-05 21:59:38 -0400 (Tue, 05 May 2026) |
| EllapsedTime: 25.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.76.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.23-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-06 01:59:13 UTC
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.76.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.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.23-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.76.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.23-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.23-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.23-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.23-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.23-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.23-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.23-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.259 0.052 0.300
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.23-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] "Tue May 5 21:59:28 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] "Tue May 5 21:59:28 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: 0x6172477ea690>
>
>
>
> 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] "Tue May 5 21:59:29 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] "Tue May 5 21:59:29 2026"
>
> ColMode(tmp2)
<pointer: 0x6172477ea690>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.8845699 0.8714151 -0.2595908 -0.635030183
[2,] 0.4569741 0.8498431 -0.1177618 0.290453077
[3,] -1.0899479 1.3495566 -0.3542284 -0.001569554
[4,] 0.7680463 -0.8316691 1.8827142 0.319491349
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-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,] 100.8845699 0.8714151 0.2595908 0.635030183
[2,] 0.4569741 0.8498431 0.1177618 0.290453077
[3,] 1.0899479 1.3495566 0.3542284 0.001569554
[4,] 0.7680463 0.8316691 1.8827142 0.319491349
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-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.0441311 0.9334962 0.5095005 0.79688781
[2,] 0.6759986 0.9218693 0.3431644 0.53893699
[3,] 1.0440057 1.1617042 0.5951709 0.03961759
[4,] 0.8763825 0.9119589 1.3721203 0.56523566
>
> 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.23-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.32588 35.20638 30.35460 33.60391
[2,] 32.21696 35.06854 28.54941 30.67982
[3,] 36.53000 37.96660 31.30594 25.39775
[4,] 34.53187 34.95126 40.60392 30.97185
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6172469d9ff0>
> exp(tmp5)
<pointer: 0x6172469d9ff0>
> log(tmp5,2)
<pointer: 0x6172469d9ff0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.0677
> Min(tmp5)
[1] 52.86208
> mean(tmp5)
[1] 72.16155
> Sum(tmp5)
[1] 14432.31
> Var(tmp5)
[1] 870.7095
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.14429 69.30049 69.57747 73.47415 74.44315 67.66980 68.98553 68.99356
[9] 68.24400 70.78307
> rowSums(tmp5)
[1] 1802.886 1386.010 1391.549 1469.483 1488.863 1353.396 1379.711 1379.871
[9] 1364.880 1415.661
> rowVars(tmp5)
[1] 8107.06749 45.77155 59.46420 66.92701 45.64034 71.62383
[7] 43.19873 102.17689 73.21988 80.53370
> rowSd(tmp5)
[1] 90.039255 6.765468 7.711303 8.180893 6.755763 8.463086 6.572574
[8] 10.108258 8.556861 8.974057
> rowMax(tmp5)
[1] 471.06767 87.43313 81.50560 85.85448 85.26518 92.64606 82.61126
[8] 85.92606 90.37745 90.40963
> rowMin(tmp5)
[1] 54.60773 59.42185 52.86208 57.43970 58.45914 55.52638 58.88655 56.23152
[9] 56.98023 56.62995
>
> colMeans(tmp5)
[1] 108.74028 72.10745 72.79054 67.70930 71.13943 68.14333 73.79192
[8] 69.92179 71.86198 72.74383 71.36881 70.16446 67.29752 71.10917
[15] 66.20049 69.18828 69.59186 70.78314 66.76356 71.81387
> colSums(tmp5)
[1] 1087.4028 721.0745 727.9054 677.0930 711.3943 681.4333 737.9192
[8] 699.2179 718.6198 727.4383 713.6881 701.6446 672.9752 711.0917
[15] 662.0049 691.8828 695.9186 707.8314 667.6356 718.1387
> colVars(tmp5)
[1] 16223.37078 44.56835 122.61749 68.95849 66.34571 54.70549
[7] 106.76134 48.29229 110.31233 88.82579 103.90811 96.31213
[13] 41.91977 23.40487 111.78908 81.94653 71.28292 42.61216
[19] 28.15811 55.10832
> colSd(tmp5)
[1] 127.370997 6.675953 11.073278 8.304125 8.145288 7.396316
[7] 10.332538 6.949265 10.502968 9.424743 10.193533 9.813874
[13] 6.474548 4.837858 10.573035 9.052433 8.442921 6.527799
[19] 5.306421 7.423498
> colMax(tmp5)
[1] 471.06767 83.87745 90.37745 80.27116 81.50560 81.20382 92.64606
[8] 77.85521 90.40963 87.43313 85.86635 87.23059 76.72621 78.44798
[15] 85.92606 85.61290 85.26518 77.91843 75.65346 85.39099
> colMin(tmp5)
[1] 63.10091 62.57163 59.42185 52.86208 56.45140 60.22197 56.98023 55.52638
[9] 57.82739 57.54948 54.60773 56.62995 57.43970 63.83461 57.52587 56.64188
[17] 56.72482 59.91029 56.23152 61.56278
>
>
> ### 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.14429 69.30049 69.57747 73.47415 74.44315 NA 68.98553 68.99356
[9] 68.24400 70.78307
> rowSums(tmp5)
[1] 1802.886 1386.010 1391.549 1469.483 1488.863 NA 1379.711 1379.871
[9] 1364.880 1415.661
> rowVars(tmp5)
[1] 8107.06749 45.77155 59.46420 66.92701 45.64034 74.06769
[7] 43.19873 102.17689 73.21988 80.53370
> rowSd(tmp5)
[1] 90.039255 6.765468 7.711303 8.180893 6.755763 8.606259 6.572574
[8] 10.108258 8.556861 8.974057
> rowMax(tmp5)
[1] 471.06767 87.43313 81.50560 85.85448 85.26518 NA 82.61126
[8] 85.92606 90.37745 90.40963
> rowMin(tmp5)
[1] 54.60773 59.42185 52.86208 57.43970 58.45914 NA 58.88655 56.23152
[9] 56.98023 56.62995
>
> colMeans(tmp5)
[1] 108.74028 72.10745 72.79054 67.70930 71.13943 68.14333 73.79192
[8] 69.92179 71.86198 72.74383 71.36881 70.16446 67.29752 71.10917
[15] 66.20049 69.18828 69.59186 70.78314 NA 71.81387
> colSums(tmp5)
[1] 1087.4028 721.0745 727.9054 677.0930 711.3943 681.4333 737.9192
[8] 699.2179 718.6198 727.4383 713.6881 701.6446 672.9752 711.0917
[15] 662.0049 691.8828 695.9186 707.8314 NA 718.1387
> colVars(tmp5)
[1] 16223.37078 44.56835 122.61749 68.95849 66.34571 54.70549
[7] 106.76134 48.29229 110.31233 88.82579 103.90811 96.31213
[13] 41.91977 23.40487 111.78908 81.94653 71.28292 42.61216
[19] NA 55.10832
> colSd(tmp5)
[1] 127.370997 6.675953 11.073278 8.304125 8.145288 7.396316
[7] 10.332538 6.949265 10.502968 9.424743 10.193533 9.813874
[13] 6.474548 4.837858 10.573035 9.052433 8.442921 6.527799
[19] NA 7.423498
> colMax(tmp5)
[1] 471.06767 83.87745 90.37745 80.27116 81.50560 81.20382 92.64606
[8] 77.85521 90.40963 87.43313 85.86635 87.23059 76.72621 78.44798
[15] 85.92606 85.61290 85.26518 77.91843 NA 85.39099
> colMin(tmp5)
[1] 63.10091 62.57163 59.42185 52.86208 56.45140 60.22197 56.98023 55.52638
[9] 57.82739 57.54948 54.60773 56.62995 57.43970 63.83461 57.52587 56.64188
[17] 56.72482 59.91029 NA 61.56278
>
> Max(tmp5,na.rm=TRUE)
[1] 471.0677
> Min(tmp5,na.rm=TRUE)
[1] 52.86208
> mean(tmp5,na.rm=TRUE)
[1] 72.20987
> Sum(tmp5,na.rm=TRUE)
[1] 14369.76
> Var(tmp5,na.rm=TRUE)
[1] 874.6377
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.14429 69.30049 69.57747 73.47415 74.44315 67.93947 68.98553 68.99356
[9] 68.24400 70.78307
> rowSums(tmp5,na.rm=TRUE)
[1] 1802.886 1386.010 1391.549 1469.483 1488.863 1290.850 1379.711 1379.871
[9] 1364.880 1415.661
> rowVars(tmp5,na.rm=TRUE)
[1] 8107.06749 45.77155 59.46420 66.92701 45.64034 74.06769
[7] 43.19873 102.17689 73.21988 80.53370
> rowSd(tmp5,na.rm=TRUE)
[1] 90.039255 6.765468 7.711303 8.180893 6.755763 8.606259 6.572574
[8] 10.108258 8.556861 8.974057
> rowMax(tmp5,na.rm=TRUE)
[1] 471.06767 87.43313 81.50560 85.85448 85.26518 92.64606 82.61126
[8] 85.92606 90.37745 90.40963
> rowMin(tmp5,na.rm=TRUE)
[1] 54.60773 59.42185 52.86208 57.43970 58.45914 55.52638 58.88655 56.23152
[9] 56.98023 56.62995
>
> colMeans(tmp5,na.rm=TRUE)
[1] 108.74028 72.10745 72.79054 67.70930 71.13943 68.14333 73.79192
[8] 69.92179 71.86198 72.74383 71.36881 70.16446 67.29752 71.10917
[15] 66.20049 69.18828 69.59186 70.78314 67.23217 71.81387
> colSums(tmp5,na.rm=TRUE)
[1] 1087.4028 721.0745 727.9054 677.0930 711.3943 681.4333 737.9192
[8] 699.2179 718.6198 727.4383 713.6881 701.6446 672.9752 711.0917
[15] 662.0049 691.8828 695.9186 707.8314 605.0896 718.1387
> colVars(tmp5,na.rm=TRUE)
[1] 16223.37078 44.56835 122.61749 68.95849 66.34571 54.70549
[7] 106.76134 48.29229 110.31233 88.82579 103.90811 96.31213
[13] 41.91977 23.40487 111.78908 81.94653 71.28292 42.61216
[19] 29.20742 55.10832
> colSd(tmp5,na.rm=TRUE)
[1] 127.370997 6.675953 11.073278 8.304125 8.145288 7.396316
[7] 10.332538 6.949265 10.502968 9.424743 10.193533 9.813874
[13] 6.474548 4.837858 10.573035 9.052433 8.442921 6.527799
[19] 5.404389 7.423498
> colMax(tmp5,na.rm=TRUE)
[1] 471.06767 83.87745 90.37745 80.27116 81.50560 81.20382 92.64606
[8] 77.85521 90.40963 87.43313 85.86635 87.23059 76.72621 78.44798
[15] 85.92606 85.61290 85.26518 77.91843 75.65346 85.39099
> colMin(tmp5,na.rm=TRUE)
[1] 63.10091 62.57163 59.42185 52.86208 56.45140 60.22197 56.98023 55.52638
[9] 57.82739 57.54948 54.60773 56.62995 57.43970 63.83461 57.52587 56.64188
[17] 56.72482 59.91029 56.23152 61.56278
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.14429 69.30049 69.57747 73.47415 74.44315 NaN 68.98553 68.99356
[9] 68.24400 70.78307
> rowSums(tmp5,na.rm=TRUE)
[1] 1802.886 1386.010 1391.549 1469.483 1488.863 0.000 1379.711 1379.871
[9] 1364.880 1415.661
> rowVars(tmp5,na.rm=TRUE)
[1] 8107.06749 45.77155 59.46420 66.92701 45.64034 NA
[7] 43.19873 102.17689 73.21988 80.53370
> rowSd(tmp5,na.rm=TRUE)
[1] 90.039255 6.765468 7.711303 8.180893 6.755763 NA 6.572574
[8] 10.108258 8.556861 8.974057
> rowMax(tmp5,na.rm=TRUE)
[1] 471.06767 87.43313 81.50560 85.85448 85.26518 NA 82.61126
[8] 85.92606 90.37745 90.40963
> rowMin(tmp5,na.rm=TRUE)
[1] 54.60773 59.42185 52.86208 57.43970 58.45914 NA 58.88655 56.23152
[9] 56.98023 56.62995
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 113.03368 72.94426 73.18782 68.56639 71.33444 68.48839 71.69702
[8] 71.52128 73.18268 73.33216 70.44389 71.26491 67.51023 70.29374
[15] 66.42827 69.72807 70.47028 70.48216 NaN 72.07084
> colSums(tmp5,na.rm=TRUE)
[1] 1017.3032 656.4983 658.6904 617.0975 642.0099 616.3955 645.2732
[8] 643.6915 658.6441 659.9894 633.9950 641.3842 607.5920 632.6437
[15] 597.8545 627.5526 634.2325 634.3394 0.0000 648.6376
> colVars(tmp5,na.rm=TRUE)
[1] 18043.91694 42.26163 136.16908 69.31406 74.21111 60.20414
[7] 70.73453 25.54719 104.47874 96.03500 107.27243 94.72762
[13] 46.65075 18.85017 125.17898 88.91195 71.51249 46.91953
[19] NA 61.25397
> colSd(tmp5,na.rm=TRUE)
[1] 134.327648 6.500895 11.669151 8.325506 8.614587 7.759132
[7] 8.410382 5.054423 10.221484 9.799745 10.357241 9.732811
[13] 6.830136 4.341678 11.188341 9.429313 8.456506 6.849784
[19] NA 7.826491
> colMax(tmp5,na.rm=TRUE)
[1] 471.06767 83.87745 90.37745 80.27116 81.50560 81.20382 80.23985
[8] 77.85521 90.40963 87.43313 85.86635 87.23059 76.72621 76.65732
[15] 85.92606 85.61290 85.26518 77.91843 -Inf 85.39099
> colMin(tmp5,na.rm=TRUE)
[1] 63.10091 62.57163 59.42185 52.86208 56.45140 60.22197 56.98023 64.65276
[9] 57.82739 57.54948 54.60773 56.62995 57.43970 63.83461 57.52587 56.64188
[17] 56.72482 59.91029 Inf 61.56278
>
>
>
>
> 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] 285.3774 263.3706 198.3426 239.5589 240.6538 246.5231 207.5502 173.6621
[9] 217.6424 353.5848
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 285.3774 263.3706 198.3426 239.5589 240.6538 246.5231 207.5502 173.6621
[9] 217.6424 353.5848
>
>
>
> 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] -2.273737e-13 0.000000e+00 8.526513e-14 1.136868e-13 -2.842171e-14
[6] -5.684342e-14 5.684342e-14 -2.842171e-14 -2.842171e-14 5.684342e-14
[11] 1.136868e-13 -2.842171e-14 -1.136868e-13 5.684342e-14 1.136868e-13
[16] -1.136868e-13 1.705303e-13 -2.842171e-14 8.526513e-14 -5.684342e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
10 14
9 18
9 18
3 6
5 19
6 4
4 10
5 5
8 8
8 6
6 9
6 10
4 19
6 14
3 15
3 11
1 9
5 14
8 13
10 16
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 3.25964
> Min(tmp)
[1] -2.833952
> mean(tmp)
[1] -0.2585033
> Sum(tmp)
[1] -25.85033
> Var(tmp)
[1] 1.075109
>
> rowMeans(tmp)
[1] -0.2585033
> rowSums(tmp)
[1] -25.85033
> rowVars(tmp)
[1] 1.075109
> rowSd(tmp)
[1] 1.036875
> rowMax(tmp)
[1] 3.25964
> rowMin(tmp)
[1] -2.833952
>
> colMeans(tmp)
[1] -0.920366293 -0.296866288 0.099512108 -1.558159758 0.151219978
[6] 0.251949416 0.574924390 0.065055628 0.473782495 -0.335174822
[11] 1.963160835 0.313049476 -0.082086965 0.176253104 0.511351044
[16] 0.019251592 -0.059661229 -1.919819616 0.158860545 -0.683321409
[21] 0.369967037 0.251534362 -0.823643290 0.385253877 3.259639613
[26] 1.015046120 -0.750284361 -0.633521271 -1.401903799 -2.833951888
[31] -0.004160516 -0.633741609 -1.399568854 -1.724165176 -1.417556177
[36] -0.636707712 -1.579282223 0.753668462 0.321947095 -1.562478583
[41] -0.558862303 -0.100466111 -0.617969925 -0.196203367 1.864398576
[46] 1.514027458 -0.820651438 -0.671995248 -1.879644839 -0.455441652
[51] -1.232407441 -0.893792049 -2.587180067 -0.040388561 0.861729982
[56] -1.175486696 0.318248185 -0.065672410 2.225004668 0.620151962
[61] -0.280639037 1.763353306 -1.601143643 -0.545170976 0.995594961
[66] 0.738442559 -0.323086813 -1.248857537 0.783082644 -0.491323989
[71] -0.918782681 0.471624745 0.361437671 -0.978093573 0.788038311
[76] -0.173650232 -1.356476095 -0.892381378 -0.572153106 -1.873644693
[81] 0.167246245 -0.287777479 -0.227367723 0.835749809 -1.588899461
[86] 0.613070192 -1.042271684 -1.017066658 -0.636693748 -1.565717170
[91] -1.555721975 1.401993058 -0.679360692 -0.306726639 0.713457520
[96] 0.413643589 -0.116176371 -0.188824567 -1.343515227 -0.051942428
> colSums(tmp)
[1] -0.920366293 -0.296866288 0.099512108 -1.558159758 0.151219978
[6] 0.251949416 0.574924390 0.065055628 0.473782495 -0.335174822
[11] 1.963160835 0.313049476 -0.082086965 0.176253104 0.511351044
[16] 0.019251592 -0.059661229 -1.919819616 0.158860545 -0.683321409
[21] 0.369967037 0.251534362 -0.823643290 0.385253877 3.259639613
[26] 1.015046120 -0.750284361 -0.633521271 -1.401903799 -2.833951888
[31] -0.004160516 -0.633741609 -1.399568854 -1.724165176 -1.417556177
[36] -0.636707712 -1.579282223 0.753668462 0.321947095 -1.562478583
[41] -0.558862303 -0.100466111 -0.617969925 -0.196203367 1.864398576
[46] 1.514027458 -0.820651438 -0.671995248 -1.879644839 -0.455441652
[51] -1.232407441 -0.893792049 -2.587180067 -0.040388561 0.861729982
[56] -1.175486696 0.318248185 -0.065672410 2.225004668 0.620151962
[61] -0.280639037 1.763353306 -1.601143643 -0.545170976 0.995594961
[66] 0.738442559 -0.323086813 -1.248857537 0.783082644 -0.491323989
[71] -0.918782681 0.471624745 0.361437671 -0.978093573 0.788038311
[76] -0.173650232 -1.356476095 -0.892381378 -0.572153106 -1.873644693
[81] 0.167246245 -0.287777479 -0.227367723 0.835749809 -1.588899461
[86] 0.613070192 -1.042271684 -1.017066658 -0.636693748 -1.565717170
[91] -1.555721975 1.401993058 -0.679360692 -0.306726639 0.713457520
[96] 0.413643589 -0.116176371 -0.188824567 -1.343515227 -0.051942428
> 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.920366293 -0.296866288 0.099512108 -1.558159758 0.151219978
[6] 0.251949416 0.574924390 0.065055628 0.473782495 -0.335174822
[11] 1.963160835 0.313049476 -0.082086965 0.176253104 0.511351044
[16] 0.019251592 -0.059661229 -1.919819616 0.158860545 -0.683321409
[21] 0.369967037 0.251534362 -0.823643290 0.385253877 3.259639613
[26] 1.015046120 -0.750284361 -0.633521271 -1.401903799 -2.833951888
[31] -0.004160516 -0.633741609 -1.399568854 -1.724165176 -1.417556177
[36] -0.636707712 -1.579282223 0.753668462 0.321947095 -1.562478583
[41] -0.558862303 -0.100466111 -0.617969925 -0.196203367 1.864398576
[46] 1.514027458 -0.820651438 -0.671995248 -1.879644839 -0.455441652
[51] -1.232407441 -0.893792049 -2.587180067 -0.040388561 0.861729982
[56] -1.175486696 0.318248185 -0.065672410 2.225004668 0.620151962
[61] -0.280639037 1.763353306 -1.601143643 -0.545170976 0.995594961
[66] 0.738442559 -0.323086813 -1.248857537 0.783082644 -0.491323989
[71] -0.918782681 0.471624745 0.361437671 -0.978093573 0.788038311
[76] -0.173650232 -1.356476095 -0.892381378 -0.572153106 -1.873644693
[81] 0.167246245 -0.287777479 -0.227367723 0.835749809 -1.588899461
[86] 0.613070192 -1.042271684 -1.017066658 -0.636693748 -1.565717170
[91] -1.555721975 1.401993058 -0.679360692 -0.306726639 0.713457520
[96] 0.413643589 -0.116176371 -0.188824567 -1.343515227 -0.051942428
> colMin(tmp)
[1] -0.920366293 -0.296866288 0.099512108 -1.558159758 0.151219978
[6] 0.251949416 0.574924390 0.065055628 0.473782495 -0.335174822
[11] 1.963160835 0.313049476 -0.082086965 0.176253104 0.511351044
[16] 0.019251592 -0.059661229 -1.919819616 0.158860545 -0.683321409
[21] 0.369967037 0.251534362 -0.823643290 0.385253877 3.259639613
[26] 1.015046120 -0.750284361 -0.633521271 -1.401903799 -2.833951888
[31] -0.004160516 -0.633741609 -1.399568854 -1.724165176 -1.417556177
[36] -0.636707712 -1.579282223 0.753668462 0.321947095 -1.562478583
[41] -0.558862303 -0.100466111 -0.617969925 -0.196203367 1.864398576
[46] 1.514027458 -0.820651438 -0.671995248 -1.879644839 -0.455441652
[51] -1.232407441 -0.893792049 -2.587180067 -0.040388561 0.861729982
[56] -1.175486696 0.318248185 -0.065672410 2.225004668 0.620151962
[61] -0.280639037 1.763353306 -1.601143643 -0.545170976 0.995594961
[66] 0.738442559 -0.323086813 -1.248857537 0.783082644 -0.491323989
[71] -0.918782681 0.471624745 0.361437671 -0.978093573 0.788038311
[76] -0.173650232 -1.356476095 -0.892381378 -0.572153106 -1.873644693
[81] 0.167246245 -0.287777479 -0.227367723 0.835749809 -1.588899461
[86] 0.613070192 -1.042271684 -1.017066658 -0.636693748 -1.565717170
[91] -1.555721975 1.401993058 -0.679360692 -0.306726639 0.713457520
[96] 0.413643589 -0.116176371 -0.188824567 -1.343515227 -0.051942428
> colMedians(tmp)
[1] -0.920366293 -0.296866288 0.099512108 -1.558159758 0.151219978
[6] 0.251949416 0.574924390 0.065055628 0.473782495 -0.335174822
[11] 1.963160835 0.313049476 -0.082086965 0.176253104 0.511351044
[16] 0.019251592 -0.059661229 -1.919819616 0.158860545 -0.683321409
[21] 0.369967037 0.251534362 -0.823643290 0.385253877 3.259639613
[26] 1.015046120 -0.750284361 -0.633521271 -1.401903799 -2.833951888
[31] -0.004160516 -0.633741609 -1.399568854 -1.724165176 -1.417556177
[36] -0.636707712 -1.579282223 0.753668462 0.321947095 -1.562478583
[41] -0.558862303 -0.100466111 -0.617969925 -0.196203367 1.864398576
[46] 1.514027458 -0.820651438 -0.671995248 -1.879644839 -0.455441652
[51] -1.232407441 -0.893792049 -2.587180067 -0.040388561 0.861729982
[56] -1.175486696 0.318248185 -0.065672410 2.225004668 0.620151962
[61] -0.280639037 1.763353306 -1.601143643 -0.545170976 0.995594961
[66] 0.738442559 -0.323086813 -1.248857537 0.783082644 -0.491323989
[71] -0.918782681 0.471624745 0.361437671 -0.978093573 0.788038311
[76] -0.173650232 -1.356476095 -0.892381378 -0.572153106 -1.873644693
[81] 0.167246245 -0.287777479 -0.227367723 0.835749809 -1.588899461
[86] 0.613070192 -1.042271684 -1.017066658 -0.636693748 -1.565717170
[91] -1.555721975 1.401993058 -0.679360692 -0.306726639 0.713457520
[96] 0.413643589 -0.116176371 -0.188824567 -1.343515227 -0.051942428
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.9203663 -0.2968663 0.09951211 -1.55816 0.15122 0.2519494 0.5749244
[2,] -0.9203663 -0.2968663 0.09951211 -1.55816 0.15122 0.2519494 0.5749244
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.06505563 0.4737825 -0.3351748 1.963161 0.3130495 -0.08208696 0.1762531
[2,] 0.06505563 0.4737825 -0.3351748 1.963161 0.3130495 -0.08208696 0.1762531
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.511351 0.01925159 -0.05966123 -1.91982 0.1588605 -0.6833214 0.369967
[2,] 0.511351 0.01925159 -0.05966123 -1.91982 0.1588605 -0.6833214 0.369967
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.2515344 -0.8236433 0.3852539 3.25964 1.015046 -0.7502844 -0.6335213
[2,] 0.2515344 -0.8236433 0.3852539 3.25964 1.015046 -0.7502844 -0.6335213
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -1.401904 -2.833952 -0.004160516 -0.6337416 -1.399569 -1.724165 -1.417556
[2,] -1.401904 -2.833952 -0.004160516 -0.6337416 -1.399569 -1.724165 -1.417556
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.6367077 -1.579282 0.7536685 0.3219471 -1.562479 -0.5588623 -0.1004661
[2,] -0.6367077 -1.579282 0.7536685 0.3219471 -1.562479 -0.5588623 -0.1004661
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.6179699 -0.1962034 1.864399 1.514027 -0.8206514 -0.6719952 -1.879645
[2,] -0.6179699 -0.1962034 1.864399 1.514027 -0.8206514 -0.6719952 -1.879645
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.4554417 -1.232407 -0.893792 -2.58718 -0.04038856 0.86173 -1.175487
[2,] -0.4554417 -1.232407 -0.893792 -2.58718 -0.04038856 0.86173 -1.175487
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.3182482 -0.06567241 2.225005 0.620152 -0.280639 1.763353 -1.601144
[2,] 0.3182482 -0.06567241 2.225005 0.620152 -0.280639 1.763353 -1.601144
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.545171 0.995595 0.7384426 -0.3230868 -1.248858 0.7830826 -0.491324
[2,] -0.545171 0.995595 0.7384426 -0.3230868 -1.248858 0.7830826 -0.491324
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.9187827 0.4716247 0.3614377 -0.9780936 0.7880383 -0.1736502 -1.356476
[2,] -0.9187827 0.4716247 0.3614377 -0.9780936 0.7880383 -0.1736502 -1.356476
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.8923814 -0.5721531 -1.873645 0.1672462 -0.2877775 -0.2273677 0.8357498
[2,] -0.8923814 -0.5721531 -1.873645 0.1672462 -0.2877775 -0.2273677 0.8357498
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -1.588899 0.6130702 -1.042272 -1.017067 -0.6366937 -1.565717 -1.555722
[2,] -1.588899 0.6130702 -1.042272 -1.017067 -0.6366937 -1.565717 -1.555722
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 1.401993 -0.6793607 -0.3067266 0.7134575 0.4136436 -0.1161764 -0.1888246
[2,] 1.401993 -0.6793607 -0.3067266 0.7134575 0.4136436 -0.1161764 -0.1888246
[,99] [,100]
[1,] -1.343515 -0.05194243
[2,] -1.343515 -0.05194243
>
>
> Max(tmp2)
[1] 2.642449
> Min(tmp2)
[1] -3.051022
> mean(tmp2)
[1] -0.008080845
> Sum(tmp2)
[1] -0.8080845
> Var(tmp2)
[1] 1.324832
>
> rowMeans(tmp2)
[1] -1.07971725 -0.10927390 -1.35725498 1.01096737 -0.73483172 0.14310573
[7] -1.49860139 2.03397813 -0.05009061 1.29930281 0.34168634 -0.28106908
[13] -0.33079818 -1.32381048 0.37525374 0.57428767 -0.50190704 1.78413921
[19] 2.54977352 0.17577941 -0.56971786 0.70400302 1.34796802 -0.81086735
[25] 0.11131135 -0.62989866 0.28846149 -0.51730993 1.65821248 0.62979349
[31] -0.99772971 -1.34639554 1.97709850 0.97443127 1.21604126 -0.67739803
[37] -0.32266308 -0.01211893 -1.05052860 0.66882499 -0.83632444 0.09789218
[43] -0.39082884 0.38349332 2.64244915 -0.39729616 -0.21892967 -1.73789292
[49] 0.19341202 0.40024107 -1.76200619 -2.29390193 -0.56491199 -1.10085223
[55] 0.47654175 0.68518975 -0.23668773 0.47144088 0.37554318 -0.38566524
[61] 0.56520781 1.16523829 -0.49192749 -2.29269342 1.34560279 0.89180537
[67] 1.85061060 0.42580312 0.31299739 1.45366797 -0.16689239 -2.12344589
[73] -0.08478760 1.51819687 0.41505337 0.11307423 0.46861465 -0.16743218
[79] -1.66330979 1.20137073 -0.61586787 -1.52968882 -0.69573766 -0.05750652
[85] 1.36382248 -1.92647046 -3.05102222 -0.32416827 -0.11165242 1.75406094
[91] -1.81971459 -1.74532692 0.66139573 1.68116888 0.14633365 1.97507242
[97] -1.28732815 0.02072957 -1.13367907 -0.31260306
> rowSums(tmp2)
[1] -1.07971725 -0.10927390 -1.35725498 1.01096737 -0.73483172 0.14310573
[7] -1.49860139 2.03397813 -0.05009061 1.29930281 0.34168634 -0.28106908
[13] -0.33079818 -1.32381048 0.37525374 0.57428767 -0.50190704 1.78413921
[19] 2.54977352 0.17577941 -0.56971786 0.70400302 1.34796802 -0.81086735
[25] 0.11131135 -0.62989866 0.28846149 -0.51730993 1.65821248 0.62979349
[31] -0.99772971 -1.34639554 1.97709850 0.97443127 1.21604126 -0.67739803
[37] -0.32266308 -0.01211893 -1.05052860 0.66882499 -0.83632444 0.09789218
[43] -0.39082884 0.38349332 2.64244915 -0.39729616 -0.21892967 -1.73789292
[49] 0.19341202 0.40024107 -1.76200619 -2.29390193 -0.56491199 -1.10085223
[55] 0.47654175 0.68518975 -0.23668773 0.47144088 0.37554318 -0.38566524
[61] 0.56520781 1.16523829 -0.49192749 -2.29269342 1.34560279 0.89180537
[67] 1.85061060 0.42580312 0.31299739 1.45366797 -0.16689239 -2.12344589
[73] -0.08478760 1.51819687 0.41505337 0.11307423 0.46861465 -0.16743218
[79] -1.66330979 1.20137073 -0.61586787 -1.52968882 -0.69573766 -0.05750652
[85] 1.36382248 -1.92647046 -3.05102222 -0.32416827 -0.11165242 1.75406094
[91] -1.81971459 -1.74532692 0.66139573 1.68116888 0.14633365 1.97507242
[97] -1.28732815 0.02072957 -1.13367907 -0.31260306
> 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.07971725 -0.10927390 -1.35725498 1.01096737 -0.73483172 0.14310573
[7] -1.49860139 2.03397813 -0.05009061 1.29930281 0.34168634 -0.28106908
[13] -0.33079818 -1.32381048 0.37525374 0.57428767 -0.50190704 1.78413921
[19] 2.54977352 0.17577941 -0.56971786 0.70400302 1.34796802 -0.81086735
[25] 0.11131135 -0.62989866 0.28846149 -0.51730993 1.65821248 0.62979349
[31] -0.99772971 -1.34639554 1.97709850 0.97443127 1.21604126 -0.67739803
[37] -0.32266308 -0.01211893 -1.05052860 0.66882499 -0.83632444 0.09789218
[43] -0.39082884 0.38349332 2.64244915 -0.39729616 -0.21892967 -1.73789292
[49] 0.19341202 0.40024107 -1.76200619 -2.29390193 -0.56491199 -1.10085223
[55] 0.47654175 0.68518975 -0.23668773 0.47144088 0.37554318 -0.38566524
[61] 0.56520781 1.16523829 -0.49192749 -2.29269342 1.34560279 0.89180537
[67] 1.85061060 0.42580312 0.31299739 1.45366797 -0.16689239 -2.12344589
[73] -0.08478760 1.51819687 0.41505337 0.11307423 0.46861465 -0.16743218
[79] -1.66330979 1.20137073 -0.61586787 -1.52968882 -0.69573766 -0.05750652
[85] 1.36382248 -1.92647046 -3.05102222 -0.32416827 -0.11165242 1.75406094
[91] -1.81971459 -1.74532692 0.66139573 1.68116888 0.14633365 1.97507242
[97] -1.28732815 0.02072957 -1.13367907 -0.31260306
> rowMin(tmp2)
[1] -1.07971725 -0.10927390 -1.35725498 1.01096737 -0.73483172 0.14310573
[7] -1.49860139 2.03397813 -0.05009061 1.29930281 0.34168634 -0.28106908
[13] -0.33079818 -1.32381048 0.37525374 0.57428767 -0.50190704 1.78413921
[19] 2.54977352 0.17577941 -0.56971786 0.70400302 1.34796802 -0.81086735
[25] 0.11131135 -0.62989866 0.28846149 -0.51730993 1.65821248 0.62979349
[31] -0.99772971 -1.34639554 1.97709850 0.97443127 1.21604126 -0.67739803
[37] -0.32266308 -0.01211893 -1.05052860 0.66882499 -0.83632444 0.09789218
[43] -0.39082884 0.38349332 2.64244915 -0.39729616 -0.21892967 -1.73789292
[49] 0.19341202 0.40024107 -1.76200619 -2.29390193 -0.56491199 -1.10085223
[55] 0.47654175 0.68518975 -0.23668773 0.47144088 0.37554318 -0.38566524
[61] 0.56520781 1.16523829 -0.49192749 -2.29269342 1.34560279 0.89180537
[67] 1.85061060 0.42580312 0.31299739 1.45366797 -0.16689239 -2.12344589
[73] -0.08478760 1.51819687 0.41505337 0.11307423 0.46861465 -0.16743218
[79] -1.66330979 1.20137073 -0.61586787 -1.52968882 -0.69573766 -0.05750652
[85] 1.36382248 -1.92647046 -3.05102222 -0.32416827 -0.11165242 1.75406094
[91] -1.81971459 -1.74532692 0.66139573 1.68116888 0.14633365 1.97507242
[97] -1.28732815 0.02072957 -1.13367907 -0.31260306
>
> colMeans(tmp2)
[1] -0.008080845
> colSums(tmp2)
[1] -0.8080845
> colVars(tmp2)
[1] 1.324832
> colSd(tmp2)
[1] 1.151013
> colMax(tmp2)
[1] 2.642449
> colMin(tmp2)
[1] -3.051022
> colMedians(tmp2)
[1] -0.03110477
> colRanges(tmp2)
[,1]
[1,] -3.051022
[2,] 2.642449
>
> 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] -2.7309247 -0.0457101 1.6242354 4.5801672 0.7390008 -7.9553718
[7] 1.9598475 -1.7712702 1.5226072 -4.5462575
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.5467181
[2,] -0.9077064
[3,] -0.4546270
[4,] 0.2491091
[5,] 1.2237358
>
> rowApply(tmp,sum)
[1] 1.9469735 2.7020035 -5.2505855 -4.5522056 -0.1016318 2.0444665
[7] 2.1717470 -1.3159390 -0.1700519 -4.0984528
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 6 8 3 4 3 2 1 9 7 5
[2,] 10 2 8 8 2 7 5 3 2 8
[3,] 7 9 6 3 1 8 10 2 10 6
[4,] 9 6 4 2 10 10 8 4 6 9
[5,] 1 5 9 5 9 9 2 6 8 7
[6,] 2 3 2 7 7 1 6 5 4 1
[7,] 8 7 5 1 8 5 7 10 5 10
[8,] 3 4 7 9 5 3 9 8 1 3
[9,] 4 10 10 6 4 6 3 7 3 4
[10,] 5 1 1 10 6 4 4 1 9 2
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.04839993 1.03603972 -1.57552541 0.17066268 -0.39999347 -2.60327010
[7] 1.37263997 0.95032412 -0.16929392 0.61351761 1.71024131 -0.76133871
[13] -0.24490433 -2.40596098 1.53377828 -2.21004416 0.60349474 1.37464959
[19] -4.82756748 -3.36879019
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.4907828
[2,] -0.4387125
[3,] -0.2890918
[4,] 0.1298595
[5,] 1.1371275
>
> rowApply(tmp,sum)
[1] -3.645931 1.166524 -2.944099 -2.651736 -1.077699
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 7 18 13 7 7
[2,] 12 10 20 19 3
[3,] 4 3 10 20 2
[4,] 10 9 2 17 20
[5,] 15 2 18 14 5
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.4907828 -0.05499391 -1.0700638 -0.1453566 0.6049877 -2.0314640
[2,] 1.1371275 -0.11144100 -0.8861721 -0.1691838 -1.4143771 0.4617398
[3,] 0.1298595 1.20094902 -0.1305570 -1.2101346 0.7155491 0.6102606
[4,] -0.4387125 1.24246934 1.7888903 0.4960000 0.3300543 -2.3591651
[5,] -0.2890918 -1.24094373 -1.2776228 1.1993378 -0.6362075 0.7153586
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 1.0231106 0.6092041 -0.4885800 -0.066725576 1.25575480 -1.0229371
[2,] -0.7136623 1.0848401 0.3831649 -0.237090550 0.15162446 0.7144499
[3,] 0.3270760 -0.5361480 0.3172458 0.832988328 -0.55742865 -0.3589639
[4,] 0.4773220 -0.9410058 -0.2045121 0.075724636 -0.06810078 -0.1337695
[5,] 0.2587938 0.7334337 -0.1766125 0.008620767 0.92839147 0.0398818
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.4153307 -1.1167057 -0.02322401 -0.79143320 1.06973201 -0.2757848
[2,] 1.2015765 1.0878951 1.75872576 0.34793508 -0.27944892 -0.2238325
[3,] -1.3527810 -0.6056837 -0.05299636 -0.88627998 -0.05006228 0.1946323
[4,] -0.6743275 -0.3250325 -0.36702929 -0.86073415 -0.48224290 0.9176992
[5,] 0.1652969 -1.4464343 0.21830218 -0.01953191 0.34551682 0.7619354
[,19] [,20]
[1,] -1.9031677 0.8571688
[2,] -0.3894211 -2.7379261
[3,] -0.4351823 -1.0964414
[4,] -1.4873705 0.3621063
[5,] -0.6124259 -0.7536978
>
>
> 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.23-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.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 649 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-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.23-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
row1 -0.03852042 0.07625671 1.104547 -0.2549631 -0.6660299 -0.3067809
col7 col8 col9 col10 col11 col12 col13
row1 -0.1112751 -0.7926549 -1.166447 0.3882704 1.945527 0.3662127 0.2040475
col14 col15 col16 col17 col18 col19 col20
row1 -0.4980926 0.2453007 -0.4369682 -0.2734879 0.5365007 -1.320243 -0.6958701
> tmp[,"col10"]
col10
row1 0.3882704
row2 -1.2271034
row3 0.6263978
row4 2.5467721
row5 -0.1710397
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -0.03852042 0.07625671 1.1045471 -0.2549631 -0.6660299 -0.3067809
row5 -0.04376071 1.31529621 0.7639262 -1.0613780 0.8445203 0.3920539
col7 col8 col9 col10 col11 col12 col13
row1 -0.1112751 -0.7926549 -1.166447 0.3882704 1.945527 0.3662127 0.2040475
row5 -1.2631344 0.2261178 -1.676017 -0.1710397 1.485135 -1.3090640 0.8523248
col14 col15 col16 col17 col18 col19 col20
row1 -0.4980926 0.2453007 -0.4369682 -0.2734879 0.5365007 -1.320243 -0.6958701
row5 -1.6281254 1.5435756 -1.1476285 -0.1919788 1.3811797 2.063019 -1.5973653
> tmp[,c("col6","col20")]
col6 col20
row1 -0.3067809 -0.69587007
row2 0.7034597 -0.64906611
row3 -0.4525837 -0.08756898
row4 0.8003133 -0.97810597
row5 0.3920539 -1.59736528
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.3067809 -0.6958701
row5 0.3920539 -1.5973653
>
>
>
>
> 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.67993 51.06804 50.18354 49.37612 49.43285 105.991 50.6132 50.92902
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.90002 51.20648 50.00094 48.14924 51.45303 51.30454 51.05433 51.19475
col17 col18 col19 col20
row1 50.78767 50.15042 50.238 106.7884
> tmp[,"col10"]
col10
row1 51.20648
row2 30.96632
row3 29.56896
row4 31.08542
row5 50.79822
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.67993 51.06804 50.18354 49.37612 49.43285 105.9910 50.61320 50.92902
row5 49.93985 49.40425 50.34205 50.34607 48.78643 107.5285 49.17215 48.47913
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.90002 51.20648 50.00094 48.14924 51.45303 51.30454 51.05433 51.19475
row5 48.87972 50.79822 49.44600 49.94181 49.48300 50.10050 51.56251 50.29549
col17 col18 col19 col20
row1 50.78767 50.15042 50.2380 106.7884
row5 49.89259 50.26878 48.5823 106.8700
> tmp[,c("col6","col20")]
col6 col20
row1 105.99098 106.78836
row2 76.08924 74.87125
row3 74.76152 75.78383
row4 74.25934 74.04610
row5 107.52855 106.87004
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.9910 106.7884
row5 107.5285 106.8700
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.9910 106.7884
row5 107.5285 106.8700
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.7074533
[2,] 0.5553992
[3,] 0.1040788
[4,] -0.2417255
[5,] 0.9168759
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.2370711 1.0492200
[2,] 0.8578493 1.3559773
[3,] 0.2798103 -0.3025453
[4,] 0.8508747 0.4079009
[5,] -0.8077871 -0.9649793
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.6704187 1.40445791
[2,] 0.1995393 0.02345605
[3,] 0.2384752 -1.40490170
[4,] -0.3196458 -0.33015734
[5,] 0.2170925 0.03753629
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.6704187
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.6704187
[2,] 0.1995393
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row3 0.7263055 0.06121849 1.077363 -0.30994929 -0.2517851 -1.6484633
row1 -0.1386110 -0.55909329 -1.990516 0.03527011 0.8652805 -0.9835878
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row3 -0.4021149 -1.8274041 -2.0048192 -0.1785675 1.186966 -1.177508 0.9948323
row1 -0.1962632 0.1136286 -0.1035326 -1.1470147 -2.181828 -1.333061 1.6559663
[,14] [,15] [,16] [,17] [,18] [,19]
row3 1.193605 1.3295756 0.1839131 -0.6776288 -0.01150531 0.09081375
row1 -1.280616 -0.7428018 2.5767049 0.3065488 1.66601064 -0.85590741
[,20]
row3 -0.06134801
row1 0.40732370
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 1.259821 1.975275 0.5715125 -1.188996 -0.8472178 -0.001196057 1.476673
[,8] [,9] [,10]
row2 0.7564334 -1.013249 -0.5309434
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.2365062 2.165167 1.975105 -0.07627929 -0.3278605 1.182642 0.4270837
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.257616 0.3943921 -0.1844847 1.203466 -0.01691893 -0.6595357 0.6714089
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -2.047957 0.9752701 0.1943946 2.341843 0.1438948 0.4366629
>
>
> 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: 0x6172477ea0b0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2717e5f912253"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2717e19df2902"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2717e62a5cc5b"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2717e39f0d7f2"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2717e5169913c"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2717e528fcd5e"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2717eeaff220"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2717eb64c02e"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2717e7f6b1833"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2717e55b7858"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2717e7a9c040d"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2717e61d8572f"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2717e2959ac85"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2717e2ae8ef58"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2717e735b961f"
>
>
> ### 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: 0x61724942cac0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x61724942cac0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x61724942cac0>
> rowMedians(tmp)
[1] -0.0588078573 -0.0411993196 0.0667568453 -0.1371291390 -0.0351805201
[6] -0.1413947267 -0.2100221704 -0.2058219420 -0.3926925733 -0.1778450560
[11] -0.0231219610 -0.5442346629 -0.2163269280 0.2523299198 0.4569232529
[16] 0.8277369087 0.1671977228 0.3045974551 0.4857706473 0.2960658814
[21] 0.2458260089 -0.0370514964 -0.0865912858 -0.3463978844 0.0448849088
[26] 0.0780765320 -0.1265877273 0.1874458218 0.1079501529 -0.0204654091
[31] -0.5295665910 -0.3864446328 -0.8041989455 -0.5326959532 0.3145761903
[36] 0.5365808865 0.0155240090 0.2649991159 -0.2713818125 -0.2899994717
[41] 0.0025863266 0.1105926449 0.1834996071 0.4077677267 0.5568622949
[46] 0.1747353447 0.0723466645 -0.1660706119 0.0376626190 -0.4692305465
[51] 0.2591493789 0.3409988871 -0.6123266588 0.2498876813 -0.3182857087
[56] 0.1745349574 0.3117247553 0.3166061173 0.0642494147 -0.0825834076
[61] 0.0233766094 -0.0028696155 -0.1300210019 -0.0951261885 0.1415409426
[66] -0.3102559593 -0.2115051978 -0.3127748537 -0.2613000435 -0.3819474185
[71] -0.0690387622 -0.1990118703 0.3682839372 -0.2717086261 -0.1567753131
[76] -0.0775042521 -0.4444138480 0.2241784336 -0.0910872138 -0.1260249872
[81] 0.4865859549 -0.3559968096 -0.2379363636 0.1729224079 -0.1120682008
[86] -0.4305257370 -0.2288316864 -0.0065788950 -0.2341112427 -0.3699237995
[91] -0.4491177042 -0.3244338673 0.0267482059 0.0889281150 -0.1310789238
[96] 0.6199453166 0.0614561047 -0.0005420001 0.3975170414 -0.1497370066
[101] 0.2299705998 0.1536350628 -0.1659373916 -0.0598623544 -0.3376468125
[106] 0.8041410990 -0.2583306924 0.1006299179 -0.6440179170 -0.2334688463
[111] -0.0237542675 -0.3012493710 -0.4054624501 0.2730417132 0.0117960160
[116] 0.1141933986 -0.0751871143 -0.0230681217 -0.6488107200 -0.4696065397
[121] 0.0055748345 -0.1089530321 0.3865286947 -0.0282680673 0.1651604999
[126] -0.4581179820 -0.3633511291 -0.1137123059 -0.1613038118 -0.3432962246
[131] 0.6764575238 -0.2717669672 -0.2561221184 0.0331453235 -0.4227614981
[136] -0.0949226109 -0.1829145340 0.0366794138 0.3564331153 0.1852248049
[141] -0.0735522935 -0.0500330017 0.2189328743 -0.3957840944 -0.0435197883
[146] 0.1997929208 -0.2383265526 -0.2026654542 -0.0925004676 0.0802939708
[151] -0.1777066654 -0.0181049471 -0.0005457841 -0.1901611175 0.2156816243
[156] 0.1736703423 0.0577831987 0.6336004818 0.3133400330 0.1047736917
[161] 0.0025603680 -0.6131804266 -0.6189698264 -0.1014612620 -0.1332754014
[166] 0.3140777443 -0.2633264762 -0.1601456349 -0.1458558132 -0.1626003679
[171] 0.0315399132 -0.3917132197 -0.0521280715 -0.2365849013 -0.2818868709
[176] -0.3866754890 -0.5102738764 -0.0380316204 0.1913209338 0.4003524840
[181] -0.1333862410 0.1679879000 0.1762861548 0.0572495278 -0.1894870987
[186] 0.2378827112 -0.6133352597 0.1974708516 0.0725320380 0.2978536065
[191] -0.2266679676 -0.0800703323 0.3755809251 0.6220946349 -0.3325883124
[196] -0.2081467153 -0.2234354872 0.1198695244 -0.2904727550 -0.0767114580
[201] -0.3250753462 -0.4513685497 0.2894175673 -0.3362491710 -0.0664119400
[206] 0.1207412982 -0.0795930793 -0.1047626021 -0.1508465703 -0.0263794318
[211] 0.4232759504 0.2981337617 0.1886814551 0.0154169853 -0.2595965825
[216] 0.2013282682 -0.1269137147 0.0807883324 0.1724991767 0.5997176842
[221] 0.0757310764 -0.0025041279 -0.0713614380 -0.0630213827 0.1417063040
[226] 0.2912325596 0.2682606843 0.6796965311 -0.2927338534 -0.7358669246
>
> proc.time()
user system elapsed
1.371 1.578 2.934
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: 0x5b025eef50f0>
> .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: 0x5b025eef50f0>
> .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: 0x5b025eef50f0>
> .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: 0x5b025eef50f0>
> 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: 0x5b025fd43690>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b025fd43690>
> .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: 0x5b025fd43690>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b025fd43690>
> .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: 0x5b025fd43690>
> 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: 0x5b026177d010>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b026177d010>
> .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: 0x5b026177d010>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5b026177d010>
> .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: 0x5b026177d010>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5b026177d010>
> .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: 0x5b026177d010>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5b026177d010>
> .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: 0x5b026177d010>
> 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: 0x5b02617cd070>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5b02617cd070>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b02617cd070>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b02617cd070>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2735d55f543e" "BufferedMatrixFile2735d576b5ae"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2735d55f543e" "BufferedMatrixFile2735d576b5ae"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b025f5ff7d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b025f5ff7d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5b025f5ff7d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5b025f5ff7d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5b025f5ff7d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5b025f5ff7d0>
> .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: 0x5b02611032d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5b02611032d0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5b02611032d0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5b02611032d0>
> 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: 0x5b02603c94a0>
> .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: 0x5b02603c94a0>
> rm(P)
>
> proc.time()
user system elapsed
0.259 0.051 0.296
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.267 0.051 0.306