| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-03-09 11:33 -0400 (Mon, 09 Mar 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences" | 4508 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2026-02-28 r89501) -- "Unsuffered Consequences" | 3381 |
| 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 256/2360 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.3 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.75.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.75.0.tar.gz |
| StartedAt: 2026-03-08 21:38:14 -0400 (Sun, 08 Mar 2026) |
| EndedAt: 2026-03-08 21:38:39 -0400 (Sun, 08 Mar 2026) |
| EllapsedTime: 25.1 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.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2026-03-05 r89546)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.4 LTS
* using session charset: UTF-8
* current time: 2026-03-09 01:38:14 UTC
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.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.75.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 Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences"
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.245 0.049 0.281
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences"
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 479482 25.7 1050322 56.1 639251 34.2
Vcells 886403 6.8 8388608 64.0 2083267 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] "Sun Mar 8 21:38:29 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] "Sun Mar 8 21:38:29 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: 0x60be3ad9b4f0>
>
>
>
> 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] "Sun Mar 8 21:38:30 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] "Sun Mar 8 21:38:30 2026"
>
> ColMode(tmp2)
<pointer: 0x60be3ad9b4f0>
>
>
>
> ### 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.98221201 2.3376501 -0.8358872 -0.7134018
[2,] -0.36342452 -0.2611557 1.0076701 0.2616071
[3,] -0.73959989 -0.3785631 0.6411269 1.4045359
[4,] 0.05351887 -1.3833854 0.7826155 0.2927687
> 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 : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.98221201 2.3376501 0.8358872 0.7134018
[2,] 0.36342452 0.2611557 1.0076701 0.2616071
[3,] 0.73959989 0.3785631 0.6411269 1.4045359
[4,] 0.05351887 1.3833854 0.7826155 0.2927687
> 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 : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0489906 1.5289376 0.9142687 0.8446312
[2,] 0.6028470 0.5110340 1.0038277 0.5114755
[3,] 0.8599999 0.6152748 0.8007040 1.1851312
[4,] 0.2313414 1.1761741 0.8846556 0.5410810
>
> 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 : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 226.47212 42.62703 34.97857 34.15971
[2,] 31.39189 30.37150 36.04595 30.37636
[3,] 34.33960 31.53131 33.64817 38.25585
[4,] 27.36693 38.14513 34.62917 30.70358
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x60be3b74baa0>
> exp(tmp5)
<pointer: 0x60be3b74baa0>
> log(tmp5,2)
<pointer: 0x60be3b74baa0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.372
> Min(tmp5)
[1] 54.18942
> mean(tmp5)
[1] 72.81023
> Sum(tmp5)
[1] 14562.05
> Var(tmp5)
[1] 874.4186
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 93.98704 69.41268 70.93077 65.00458 69.80051 72.61978 69.19242 73.43606
[9] 71.94353 71.77494
> rowSums(tmp5)
[1] 1879.741 1388.254 1418.615 1300.092 1396.010 1452.396 1383.848 1468.721
[9] 1438.871 1435.499
> rowVars(tmp5)
[1] 7968.35401 53.74126 90.64024 65.01319 69.43070 57.11932
[7] 72.77967 84.08763 74.21727 45.25490
> rowSd(tmp5)
[1] 89.265637 7.330843 9.520517 8.063076 8.332509 7.557733 8.531100
[8] 9.169931 8.614945 6.727176
> rowMax(tmp5)
[1] 471.37204 86.86412 89.43117 82.25877 83.92814 89.30168 90.75692
[8] 93.40250 87.39540 87.21747
> rowMin(tmp5)
[1] 60.93626 57.72400 56.52860 54.18942 57.05493 60.51117 54.45400 59.42369
[9] 59.75982 60.15075
>
> colMeans(tmp5)
[1] 105.16314 77.09981 70.18344 71.21679 67.16709 69.83205 70.96786
[8] 75.32790 73.35747 67.71967 65.62519 73.00956 66.19144 73.94572
[15] 69.12061 72.92684 71.22358 73.15754 71.90977 71.05917
> colSums(tmp5)
[1] 1051.6314 770.9981 701.8344 712.1679 671.6709 698.3205 709.6786
[8] 753.2790 733.5747 677.1967 656.2519 730.0956 661.9144 739.4572
[15] 691.2061 729.2684 712.2358 731.5754 719.0977 710.5917
> colVars(tmp5)
[1] 16579.68901 115.34782 51.69350 52.66736 60.62001 102.42614
[7] 58.51956 110.80637 46.09232 70.07669 67.54882 30.87491
[13] 59.22008 122.12706 47.72186 21.51390 57.52509 65.89489
[19] 66.61337 138.37109
> colSd(tmp5)
[1] 128.762141 10.740010 7.189819 7.257228 7.785885 10.120580
[7] 7.649808 10.526461 6.789132 8.371182 8.218809 5.556519
[13] 7.695458 11.051111 6.908101 4.638308 7.584530 8.117567
[19] 8.161701 11.763124
> colMax(tmp5)
[1] 471.37204 93.40250 81.66170 85.97131 87.39540 86.86412 84.51507
[8] 90.75692 83.96247 82.05771 83.80512 84.16295 82.79072 88.74112
[15] 80.16214 82.25877 80.48792 85.72724 89.43117 90.19582
> colMin(tmp5)
[1] 56.96069 63.21429 54.45400 63.22442 60.42067 55.32180 61.34034 56.06193
[9] 65.93054 56.34167 54.18942 64.65974 56.50243 61.53302 59.29274 66.16789
[17] 60.44329 60.00722 60.95872 57.05493
>
>
> ### 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.98704 69.41268 70.93077 65.00458 69.80051 72.61978 69.19242 NA
[9] 71.94353 71.77494
> rowSums(tmp5)
[1] 1879.741 1388.254 1418.615 1300.092 1396.010 1452.396 1383.848 NA
[9] 1438.871 1435.499
> rowVars(tmp5)
[1] 7968.35401 53.74126 90.64024 65.01319 69.43070 57.11932
[7] 72.77967 88.29685 74.21727 45.25490
> rowSd(tmp5)
[1] 89.265637 7.330843 9.520517 8.063076 8.332509 7.557733 8.531100
[8] 9.396640 8.614945 6.727176
> rowMax(tmp5)
[1] 471.37204 86.86412 89.43117 82.25877 83.92814 89.30168 90.75692
[8] NA 87.39540 87.21747
> rowMin(tmp5)
[1] 60.93626 57.72400 56.52860 54.18942 57.05493 60.51117 54.45400 NA
[9] 59.75982 60.15075
>
> colMeans(tmp5)
[1] 105.16314 77.09981 70.18344 71.21679 67.16709 69.83205 70.96786
[8] 75.32790 73.35747 67.71967 65.62519 73.00956 66.19144 73.94572
[15] 69.12061 72.92684 NA 73.15754 71.90977 71.05917
> colSums(tmp5)
[1] 1051.6314 770.9981 701.8344 712.1679 671.6709 698.3205 709.6786
[8] 753.2790 733.5747 677.1967 656.2519 730.0956 661.9144 739.4572
[15] 691.2061 729.2684 NA 731.5754 719.0977 710.5917
> colVars(tmp5)
[1] 16579.68901 115.34782 51.69350 52.66736 60.62001 102.42614
[7] 58.51956 110.80637 46.09232 70.07669 67.54882 30.87491
[13] 59.22008 122.12706 47.72186 21.51390 NA 65.89489
[19] 66.61337 138.37109
> colSd(tmp5)
[1] 128.762141 10.740010 7.189819 7.257228 7.785885 10.120580
[7] 7.649808 10.526461 6.789132 8.371182 8.218809 5.556519
[13] 7.695458 11.051111 6.908101 4.638308 NA 8.117567
[19] 8.161701 11.763124
> colMax(tmp5)
[1] 471.37204 93.40250 81.66170 85.97131 87.39540 86.86412 84.51507
[8] 90.75692 83.96247 82.05771 83.80512 84.16295 82.79072 88.74112
[15] 80.16214 82.25877 NA 85.72724 89.43117 90.19582
> colMin(tmp5)
[1] 56.96069 63.21429 54.45400 63.22442 60.42067 55.32180 61.34034 56.06193
[9] 65.93054 56.34167 54.18942 64.65974 56.50243 61.53302 59.29274 66.16789
[17] NA 60.00722 60.95872 57.05493
>
> Max(tmp5,na.rm=TRUE)
[1] 471.372
> Min(tmp5,na.rm=TRUE)
[1] 54.18942
> mean(tmp5,na.rm=TRUE)
[1] 72.82122
> Sum(tmp5,na.rm=TRUE)
[1] 14491.42
> Var(tmp5,na.rm=TRUE)
[1] 878.8106
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 93.98704 69.41268 70.93077 65.00458 69.80051 72.61978 69.19242 73.58405
[9] 71.94353 71.77494
> rowSums(tmp5,na.rm=TRUE)
[1] 1879.741 1388.254 1418.615 1300.092 1396.010 1452.396 1383.848 1398.097
[9] 1438.871 1435.499
> rowVars(tmp5,na.rm=TRUE)
[1] 7968.35401 53.74126 90.64024 65.01319 69.43070 57.11932
[7] 72.77967 88.29685 74.21727 45.25490
> rowSd(tmp5,na.rm=TRUE)
[1] 89.265637 7.330843 9.520517 8.063076 8.332509 7.557733 8.531100
[8] 9.396640 8.614945 6.727176
> rowMax(tmp5,na.rm=TRUE)
[1] 471.37204 86.86412 89.43117 82.25877 83.92814 89.30168 90.75692
[8] 93.40250 87.39540 87.21747
> rowMin(tmp5,na.rm=TRUE)
[1] 60.93626 57.72400 56.52860 54.18942 57.05493 60.51117 54.45400 59.42369
[9] 59.75982 60.15075
>
> colMeans(tmp5,na.rm=TRUE)
[1] 105.16314 77.09981 70.18344 71.21679 67.16709 69.83205 70.96786
[8] 75.32790 73.35747 67.71967 65.62519 73.00956 66.19144 73.94572
[15] 69.12061 72.92684 71.29016 73.15754 71.90977 71.05917
> colSums(tmp5,na.rm=TRUE)
[1] 1051.6314 770.9981 701.8344 712.1679 671.6709 698.3205 709.6786
[8] 753.2790 733.5747 677.1967 656.2519 730.0956 661.9144 739.4572
[15] 691.2061 729.2684 641.6114 731.5754 719.0977 710.5917
> colVars(tmp5,na.rm=TRUE)
[1] 16579.68901 115.34782 51.69350 52.66736 60.62001 102.42614
[7] 58.51956 110.80637 46.09232 70.07669 67.54882 30.87491
[13] 59.22008 122.12706 47.72186 21.51390 64.66586 65.89489
[19] 66.61337 138.37109
> colSd(tmp5,na.rm=TRUE)
[1] 128.762141 10.740010 7.189819 7.257228 7.785885 10.120580
[7] 7.649808 10.526461 6.789132 8.371182 8.218809 5.556519
[13] 7.695458 11.051111 6.908101 4.638308 8.041509 8.117567
[19] 8.161701 11.763124
> colMax(tmp5,na.rm=TRUE)
[1] 471.37204 93.40250 81.66170 85.97131 87.39540 86.86412 84.51507
[8] 90.75692 83.96247 82.05771 83.80512 84.16295 82.79072 88.74112
[15] 80.16214 82.25877 80.48792 85.72724 89.43117 90.19582
> colMin(tmp5,na.rm=TRUE)
[1] 56.96069 63.21429 54.45400 63.22442 60.42067 55.32180 61.34034 56.06193
[9] 65.93054 56.34167 54.18942 64.65974 56.50243 61.53302 59.29274 66.16789
[17] 60.44329 60.00722 60.95872 57.05493
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 93.98704 69.41268 70.93077 65.00458 69.80051 72.61978 69.19242 NaN
[9] 71.94353 71.77494
> rowSums(tmp5,na.rm=TRUE)
[1] 1879.741 1388.254 1418.615 1300.092 1396.010 1452.396 1383.848 0.000
[9] 1438.871 1435.499
> rowVars(tmp5,na.rm=TRUE)
[1] 7968.35401 53.74126 90.64024 65.01319 69.43070 57.11932
[7] 72.77967 NA 74.21727 45.25490
> rowSd(tmp5,na.rm=TRUE)
[1] 89.265637 7.330843 9.520517 8.063076 8.332509 7.557733 8.531100
[8] NA 8.614945 6.727176
> rowMax(tmp5,na.rm=TRUE)
[1] 471.37204 86.86412 89.43117 82.25877 83.92814 89.30168 90.75692
[8] NA 87.39540 87.21747
> rowMin(tmp5,na.rm=TRUE)
[1] 60.93626 57.72400 56.52860 54.18942 57.05493 60.51117 54.45400 NA
[9] 59.75982 60.15075
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 110.24530 75.28840 69.87593 71.71727 67.91670 69.59280 71.07403
[8] 74.94239 72.68258 68.44788 65.26854 72.25421 66.71165 72.30178
[15] 68.69615 72.76081 NaN 72.45636 71.39327 69.89766
> colSums(tmp5,na.rm=TRUE)
[1] 992.2077 677.5956 628.8833 645.4554 611.2503 626.3352 639.6663 674.4815
[9] 654.1432 616.0309 587.4168 650.2879 600.4049 650.7161 618.2654 654.8473
[17] 0.0000 652.1073 642.5394 629.0790
> colVars(tmp5,na.rm=TRUE)
[1] 18361.58108 92.85272 57.09134 56.43288 61.87608 114.58548
[7] 65.70768 122.98522 46.72981 72.87050 74.56145 28.31560
[13] 63.57811 106.98961 51.66026 23.89302 NA 68.60075
[19] 71.93881 140.49025
> colSd(tmp5,na.rm=TRUE)
[1] 135.504912 9.636012 7.555881 7.512182 7.866135 10.704461
[7] 8.106027 11.089870 6.835921 8.536422 8.634897 5.321241
[13] 7.973588 10.343578 7.187507 4.888049 NA 8.282557
[19] 8.481675 11.852858
> colMax(tmp5,na.rm=TRUE)
[1] 471.37204 88.72257 81.66170 85.97131 87.39540 86.86412 84.51507
[8] 90.75692 83.96247 82.05771 83.80512 84.16295 82.79072 86.49647
[15] 80.16214 82.25877 -Inf 85.72724 89.43117 90.19582
> colMin(tmp5,na.rm=TRUE)
[1] 56.96069 63.21429 54.45400 63.22442 61.26546 55.32180 61.34034 56.06193
[9] 65.93054 56.34167 54.18942 64.65974 56.50243 61.53302 59.29274 66.16789
[17] Inf 60.00722 60.95872 57.05493
>
>
>
>
> 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] 196.33671 192.05261 365.21546 251.92666 203.91184 378.20104 238.31537
[8] 84.29075 263.21995 287.06351
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 196.33671 192.05261 365.21546 251.92666 203.91184 378.20104 238.31537
[8] 84.29075 263.21995 287.06351
>
>
>
> 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] 0.000000e+00 1.136868e-13 0.000000e+00 -8.526513e-14 5.684342e-14
[6] -5.684342e-14 5.684342e-14 -1.421085e-13 5.684342e-14 1.705303e-13
[11] 5.684342e-14 1.705303e-13 -5.684342e-14 -1.136868e-13 9.947598e-14
[16] -5.684342e-14 -2.273737e-13 -5.684342e-14 0.000000e+00 0.000000e+00
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
10 20
1 5
6 12
8 4
5 10
6 16
2 8
9 12
2 10
1 5
9 11
2 2
2 12
7 10
9 3
6 7
6 11
5 9
5 1
7 14
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.185816
> Min(tmp)
[1] -2.202635
> mean(tmp)
[1] 0.01694521
> Sum(tmp)
[1] 1.694521
> Var(tmp)
[1] 0.9001417
>
> rowMeans(tmp)
[1] 0.01694521
> rowSums(tmp)
[1] 1.694521
> rowVars(tmp)
[1] 0.9001417
> rowSd(tmp)
[1] 0.948758
> rowMax(tmp)
[1] 2.185816
> rowMin(tmp)
[1] -2.202635
>
> colMeans(tmp)
[1] 0.56341839 1.64485622 -0.86906278 -1.78979283 0.74962149 -0.68944384
[7] 1.76057525 0.70132649 -1.95071647 -0.72755744 0.27597509 -0.07096420
[13] -1.07940783 0.70358654 -0.87197288 0.01733235 0.88834959 0.03782642
[19] 0.32296315 -2.03108437 1.04719029 -0.37731511 0.58738032 -0.16272821
[25] -0.53916454 0.47268826 0.03278251 -0.62662825 0.64899302 0.04709752
[31] 0.20223387 -1.61156494 -0.19720137 -0.29164531 -0.37991304 0.28359911
[37] 0.78083854 -0.11738463 0.36383013 0.99610739 1.49342598 0.20258367
[43] -0.21337260 -0.02269144 -2.20263508 0.24651780 0.50965542 0.82055182
[49] -0.31228286 -1.29049306 -1.92619014 -0.39326086 -0.05530596 -0.36316708
[55] 0.74223798 -0.66979425 -1.01731168 -0.94772912 1.22425652 -1.37481703
[61] 1.23719346 0.16167769 0.64315756 -0.38846308 0.90841267 1.05828776
[67] -0.54396164 -0.81227294 -1.10061185 -0.06094240 -0.04808183 0.33445892
[73] 1.99973807 0.58928794 0.40868132 1.72401392 -0.08419447 -0.71103552
[79] 1.08540413 1.29401281 0.78652437 0.15893441 -1.71886273 -0.15373929
[85] -0.61838651 0.14693678 -1.56083791 0.96989765 0.22553093 2.18581572
[91] 0.81907821 0.15602038 1.58008826 -0.60716781 0.43698970 0.74614561
[97] -1.12245390 -0.20405725 0.21030999 -1.63220981
> colSums(tmp)
[1] 0.56341839 1.64485622 -0.86906278 -1.78979283 0.74962149 -0.68944384
[7] 1.76057525 0.70132649 -1.95071647 -0.72755744 0.27597509 -0.07096420
[13] -1.07940783 0.70358654 -0.87197288 0.01733235 0.88834959 0.03782642
[19] 0.32296315 -2.03108437 1.04719029 -0.37731511 0.58738032 -0.16272821
[25] -0.53916454 0.47268826 0.03278251 -0.62662825 0.64899302 0.04709752
[31] 0.20223387 -1.61156494 -0.19720137 -0.29164531 -0.37991304 0.28359911
[37] 0.78083854 -0.11738463 0.36383013 0.99610739 1.49342598 0.20258367
[43] -0.21337260 -0.02269144 -2.20263508 0.24651780 0.50965542 0.82055182
[49] -0.31228286 -1.29049306 -1.92619014 -0.39326086 -0.05530596 -0.36316708
[55] 0.74223798 -0.66979425 -1.01731168 -0.94772912 1.22425652 -1.37481703
[61] 1.23719346 0.16167769 0.64315756 -0.38846308 0.90841267 1.05828776
[67] -0.54396164 -0.81227294 -1.10061185 -0.06094240 -0.04808183 0.33445892
[73] 1.99973807 0.58928794 0.40868132 1.72401392 -0.08419447 -0.71103552
[79] 1.08540413 1.29401281 0.78652437 0.15893441 -1.71886273 -0.15373929
[85] -0.61838651 0.14693678 -1.56083791 0.96989765 0.22553093 2.18581572
[91] 0.81907821 0.15602038 1.58008826 -0.60716781 0.43698970 0.74614561
[97] -1.12245390 -0.20405725 0.21030999 -1.63220981
> 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.56341839 1.64485622 -0.86906278 -1.78979283 0.74962149 -0.68944384
[7] 1.76057525 0.70132649 -1.95071647 -0.72755744 0.27597509 -0.07096420
[13] -1.07940783 0.70358654 -0.87197288 0.01733235 0.88834959 0.03782642
[19] 0.32296315 -2.03108437 1.04719029 -0.37731511 0.58738032 -0.16272821
[25] -0.53916454 0.47268826 0.03278251 -0.62662825 0.64899302 0.04709752
[31] 0.20223387 -1.61156494 -0.19720137 -0.29164531 -0.37991304 0.28359911
[37] 0.78083854 -0.11738463 0.36383013 0.99610739 1.49342598 0.20258367
[43] -0.21337260 -0.02269144 -2.20263508 0.24651780 0.50965542 0.82055182
[49] -0.31228286 -1.29049306 -1.92619014 -0.39326086 -0.05530596 -0.36316708
[55] 0.74223798 -0.66979425 -1.01731168 -0.94772912 1.22425652 -1.37481703
[61] 1.23719346 0.16167769 0.64315756 -0.38846308 0.90841267 1.05828776
[67] -0.54396164 -0.81227294 -1.10061185 -0.06094240 -0.04808183 0.33445892
[73] 1.99973807 0.58928794 0.40868132 1.72401392 -0.08419447 -0.71103552
[79] 1.08540413 1.29401281 0.78652437 0.15893441 -1.71886273 -0.15373929
[85] -0.61838651 0.14693678 -1.56083791 0.96989765 0.22553093 2.18581572
[91] 0.81907821 0.15602038 1.58008826 -0.60716781 0.43698970 0.74614561
[97] -1.12245390 -0.20405725 0.21030999 -1.63220981
> colMin(tmp)
[1] 0.56341839 1.64485622 -0.86906278 -1.78979283 0.74962149 -0.68944384
[7] 1.76057525 0.70132649 -1.95071647 -0.72755744 0.27597509 -0.07096420
[13] -1.07940783 0.70358654 -0.87197288 0.01733235 0.88834959 0.03782642
[19] 0.32296315 -2.03108437 1.04719029 -0.37731511 0.58738032 -0.16272821
[25] -0.53916454 0.47268826 0.03278251 -0.62662825 0.64899302 0.04709752
[31] 0.20223387 -1.61156494 -0.19720137 -0.29164531 -0.37991304 0.28359911
[37] 0.78083854 -0.11738463 0.36383013 0.99610739 1.49342598 0.20258367
[43] -0.21337260 -0.02269144 -2.20263508 0.24651780 0.50965542 0.82055182
[49] -0.31228286 -1.29049306 -1.92619014 -0.39326086 -0.05530596 -0.36316708
[55] 0.74223798 -0.66979425 -1.01731168 -0.94772912 1.22425652 -1.37481703
[61] 1.23719346 0.16167769 0.64315756 -0.38846308 0.90841267 1.05828776
[67] -0.54396164 -0.81227294 -1.10061185 -0.06094240 -0.04808183 0.33445892
[73] 1.99973807 0.58928794 0.40868132 1.72401392 -0.08419447 -0.71103552
[79] 1.08540413 1.29401281 0.78652437 0.15893441 -1.71886273 -0.15373929
[85] -0.61838651 0.14693678 -1.56083791 0.96989765 0.22553093 2.18581572
[91] 0.81907821 0.15602038 1.58008826 -0.60716781 0.43698970 0.74614561
[97] -1.12245390 -0.20405725 0.21030999 -1.63220981
> colMedians(tmp)
[1] 0.56341839 1.64485622 -0.86906278 -1.78979283 0.74962149 -0.68944384
[7] 1.76057525 0.70132649 -1.95071647 -0.72755744 0.27597509 -0.07096420
[13] -1.07940783 0.70358654 -0.87197288 0.01733235 0.88834959 0.03782642
[19] 0.32296315 -2.03108437 1.04719029 -0.37731511 0.58738032 -0.16272821
[25] -0.53916454 0.47268826 0.03278251 -0.62662825 0.64899302 0.04709752
[31] 0.20223387 -1.61156494 -0.19720137 -0.29164531 -0.37991304 0.28359911
[37] 0.78083854 -0.11738463 0.36383013 0.99610739 1.49342598 0.20258367
[43] -0.21337260 -0.02269144 -2.20263508 0.24651780 0.50965542 0.82055182
[49] -0.31228286 -1.29049306 -1.92619014 -0.39326086 -0.05530596 -0.36316708
[55] 0.74223798 -0.66979425 -1.01731168 -0.94772912 1.22425652 -1.37481703
[61] 1.23719346 0.16167769 0.64315756 -0.38846308 0.90841267 1.05828776
[67] -0.54396164 -0.81227294 -1.10061185 -0.06094240 -0.04808183 0.33445892
[73] 1.99973807 0.58928794 0.40868132 1.72401392 -0.08419447 -0.71103552
[79] 1.08540413 1.29401281 0.78652437 0.15893441 -1.71886273 -0.15373929
[85] -0.61838651 0.14693678 -1.56083791 0.96989765 0.22553093 2.18581572
[91] 0.81907821 0.15602038 1.58008826 -0.60716781 0.43698970 0.74614561
[97] -1.12245390 -0.20405725 0.21030999 -1.63220981
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.5634184 1.644856 -0.8690628 -1.789793 0.7496215 -0.6894438 1.760575
[2,] 0.5634184 1.644856 -0.8690628 -1.789793 0.7496215 -0.6894438 1.760575
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.7013265 -1.950716 -0.7275574 0.2759751 -0.0709642 -1.079408 0.7035865
[2,] 0.7013265 -1.950716 -0.7275574 0.2759751 -0.0709642 -1.079408 0.7035865
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.8719729 0.01733235 0.8883496 0.03782642 0.3229632 -2.031084 1.04719
[2,] -0.8719729 0.01733235 0.8883496 0.03782642 0.3229632 -2.031084 1.04719
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.3773151 0.5873803 -0.1627282 -0.5391645 0.4726883 0.03278251 -0.6266282
[2,] -0.3773151 0.5873803 -0.1627282 -0.5391645 0.4726883 0.03278251 -0.6266282
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.648993 0.04709752 0.2022339 -1.611565 -0.1972014 -0.2916453 -0.379913
[2,] 0.648993 0.04709752 0.2022339 -1.611565 -0.1972014 -0.2916453 -0.379913
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.2835991 0.7808385 -0.1173846 0.3638301 0.9961074 1.493426 0.2025837
[2,] 0.2835991 0.7808385 -0.1173846 0.3638301 0.9961074 1.493426 0.2025837
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.2133726 -0.02269144 -2.202635 0.2465178 0.5096554 0.8205518 -0.3122829
[2,] -0.2133726 -0.02269144 -2.202635 0.2465178 0.5096554 0.8205518 -0.3122829
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -1.290493 -1.92619 -0.3932609 -0.05530596 -0.3631671 0.742238 -0.6697943
[2,] -1.290493 -1.92619 -0.3932609 -0.05530596 -0.3631671 0.742238 -0.6697943
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -1.017312 -0.9477291 1.224257 -1.374817 1.237193 0.1616777 0.6431576
[2,] -1.017312 -0.9477291 1.224257 -1.374817 1.237193 0.1616777 0.6431576
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.3884631 0.9084127 1.058288 -0.5439616 -0.8122729 -1.100612 -0.0609424
[2,] -0.3884631 0.9084127 1.058288 -0.5439616 -0.8122729 -1.100612 -0.0609424
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.04808183 0.3344589 1.999738 0.5892879 0.4086813 1.724014 -0.08419447
[2,] -0.04808183 0.3344589 1.999738 0.5892879 0.4086813 1.724014 -0.08419447
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.7110355 1.085404 1.294013 0.7865244 0.1589344 -1.718863 -0.1537393
[2,] -0.7110355 1.085404 1.294013 0.7865244 0.1589344 -1.718863 -0.1537393
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.6183865 0.1469368 -1.560838 0.9698976 0.2255309 2.185816 0.8190782
[2,] -0.6183865 0.1469368 -1.560838 0.9698976 0.2255309 2.185816 0.8190782
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 0.1560204 1.580088 -0.6071678 0.4369897 0.7461456 -1.122454 -0.2040572
[2,] 0.1560204 1.580088 -0.6071678 0.4369897 0.7461456 -1.122454 -0.2040572
[,99] [,100]
[1,] 0.21031 -1.63221
[2,] 0.21031 -1.63221
>
>
> Max(tmp2)
[1] 2.575853
> Min(tmp2)
[1] -2.047702
> mean(tmp2)
[1] -0.08617443
> Sum(tmp2)
[1] -8.617443
> Var(tmp2)
[1] 1.014054
>
> rowMeans(tmp2)
[1] -0.89057122 0.10544130 1.18783787 2.57585295 -0.59453736 -0.35443193
[7] 0.47977907 0.42691095 0.22289210 -1.85439778 1.56207673 0.08201437
[13] -0.97075756 0.23960645 0.48490206 0.17263346 -0.32772060 -1.19534448
[19] -0.03840411 -0.41733858 -1.95343452 -1.33822734 0.48178329 -1.45313277
[25] 0.89528622 -0.30535607 -0.02187059 -0.49790572 0.14102638 -0.53317212
[31] 0.15450464 0.30997368 0.04643520 0.85782439 -0.55600636 0.86182261
[37] 2.02154581 -1.59112414 1.06597990 0.21686662 -0.06661396 -1.44451206
[43] -0.86869042 0.36420075 -0.61117056 -0.48203822 0.48006585 0.60209413
[49] -0.40498127 -1.29083694 0.46923499 0.73240255 0.41494007 1.78428662
[55] 0.05016111 -0.11277978 0.63640412 -0.81559979 0.21365199 -0.47346639
[61] -0.95604929 0.37732619 0.33102424 -0.33625087 0.91106146 -0.95685822
[67] 0.01308886 -0.60741250 0.87131218 -1.23730586 2.17462344 0.46517702
[73] 1.01539882 -2.04770237 -0.85513657 -1.30323791 1.98754461 0.48949629
[79] -0.81080647 -1.30217808 -2.02592792 -0.08741750 -2.04728199 -1.89465830
[85] 1.43062606 -0.08972923 0.97643576 0.96954713 0.17781453 -0.39755356
[91] 1.13198560 -1.44672569 -0.54671730 -0.86564377 1.13752088 0.39589938
[97] -1.00472936 0.62246602 -1.92825442 -0.22422960
> rowSums(tmp2)
[1] -0.89057122 0.10544130 1.18783787 2.57585295 -0.59453736 -0.35443193
[7] 0.47977907 0.42691095 0.22289210 -1.85439778 1.56207673 0.08201437
[13] -0.97075756 0.23960645 0.48490206 0.17263346 -0.32772060 -1.19534448
[19] -0.03840411 -0.41733858 -1.95343452 -1.33822734 0.48178329 -1.45313277
[25] 0.89528622 -0.30535607 -0.02187059 -0.49790572 0.14102638 -0.53317212
[31] 0.15450464 0.30997368 0.04643520 0.85782439 -0.55600636 0.86182261
[37] 2.02154581 -1.59112414 1.06597990 0.21686662 -0.06661396 -1.44451206
[43] -0.86869042 0.36420075 -0.61117056 -0.48203822 0.48006585 0.60209413
[49] -0.40498127 -1.29083694 0.46923499 0.73240255 0.41494007 1.78428662
[55] 0.05016111 -0.11277978 0.63640412 -0.81559979 0.21365199 -0.47346639
[61] -0.95604929 0.37732619 0.33102424 -0.33625087 0.91106146 -0.95685822
[67] 0.01308886 -0.60741250 0.87131218 -1.23730586 2.17462344 0.46517702
[73] 1.01539882 -2.04770237 -0.85513657 -1.30323791 1.98754461 0.48949629
[79] -0.81080647 -1.30217808 -2.02592792 -0.08741750 -2.04728199 -1.89465830
[85] 1.43062606 -0.08972923 0.97643576 0.96954713 0.17781453 -0.39755356
[91] 1.13198560 -1.44672569 -0.54671730 -0.86564377 1.13752088 0.39589938
[97] -1.00472936 0.62246602 -1.92825442 -0.22422960
> rowVars(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowSd(tmp2)
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> rowMax(tmp2)
[1] -0.89057122 0.10544130 1.18783787 2.57585295 -0.59453736 -0.35443193
[7] 0.47977907 0.42691095 0.22289210 -1.85439778 1.56207673 0.08201437
[13] -0.97075756 0.23960645 0.48490206 0.17263346 -0.32772060 -1.19534448
[19] -0.03840411 -0.41733858 -1.95343452 -1.33822734 0.48178329 -1.45313277
[25] 0.89528622 -0.30535607 -0.02187059 -0.49790572 0.14102638 -0.53317212
[31] 0.15450464 0.30997368 0.04643520 0.85782439 -0.55600636 0.86182261
[37] 2.02154581 -1.59112414 1.06597990 0.21686662 -0.06661396 -1.44451206
[43] -0.86869042 0.36420075 -0.61117056 -0.48203822 0.48006585 0.60209413
[49] -0.40498127 -1.29083694 0.46923499 0.73240255 0.41494007 1.78428662
[55] 0.05016111 -0.11277978 0.63640412 -0.81559979 0.21365199 -0.47346639
[61] -0.95604929 0.37732619 0.33102424 -0.33625087 0.91106146 -0.95685822
[67] 0.01308886 -0.60741250 0.87131218 -1.23730586 2.17462344 0.46517702
[73] 1.01539882 -2.04770237 -0.85513657 -1.30323791 1.98754461 0.48949629
[79] -0.81080647 -1.30217808 -2.02592792 -0.08741750 -2.04728199 -1.89465830
[85] 1.43062606 -0.08972923 0.97643576 0.96954713 0.17781453 -0.39755356
[91] 1.13198560 -1.44672569 -0.54671730 -0.86564377 1.13752088 0.39589938
[97] -1.00472936 0.62246602 -1.92825442 -0.22422960
> rowMin(tmp2)
[1] -0.89057122 0.10544130 1.18783787 2.57585295 -0.59453736 -0.35443193
[7] 0.47977907 0.42691095 0.22289210 -1.85439778 1.56207673 0.08201437
[13] -0.97075756 0.23960645 0.48490206 0.17263346 -0.32772060 -1.19534448
[19] -0.03840411 -0.41733858 -1.95343452 -1.33822734 0.48178329 -1.45313277
[25] 0.89528622 -0.30535607 -0.02187059 -0.49790572 0.14102638 -0.53317212
[31] 0.15450464 0.30997368 0.04643520 0.85782439 -0.55600636 0.86182261
[37] 2.02154581 -1.59112414 1.06597990 0.21686662 -0.06661396 -1.44451206
[43] -0.86869042 0.36420075 -0.61117056 -0.48203822 0.48006585 0.60209413
[49] -0.40498127 -1.29083694 0.46923499 0.73240255 0.41494007 1.78428662
[55] 0.05016111 -0.11277978 0.63640412 -0.81559979 0.21365199 -0.47346639
[61] -0.95604929 0.37732619 0.33102424 -0.33625087 0.91106146 -0.95685822
[67] 0.01308886 -0.60741250 0.87131218 -1.23730586 2.17462344 0.46517702
[73] 1.01539882 -2.04770237 -0.85513657 -1.30323791 1.98754461 0.48949629
[79] -0.81080647 -1.30217808 -2.02592792 -0.08741750 -2.04728199 -1.89465830
[85] 1.43062606 -0.08972923 0.97643576 0.96954713 0.17781453 -0.39755356
[91] 1.13198560 -1.44672569 -0.54671730 -0.86564377 1.13752088 0.39589938
[97] -1.00472936 0.62246602 -1.92825442 -0.22422960
>
> colMeans(tmp2)
[1] -0.08617443
> colSums(tmp2)
[1] -8.617443
> colVars(tmp2)
[1] 1.014054
> colSd(tmp2)
[1] 1.007002
> colMax(tmp2)
[1] 2.575853
> colMin(tmp2)
[1] -2.047702
> colMedians(tmp2)
[1] -0.004390866
> colRanges(tmp2)
[,1]
[1,] -2.047702
[2,] 2.575853
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.27192601 6.17913399 -1.55844893 0.12695516 2.71513390 -0.07688262
[7] 0.17401820 -1.21226682 0.83966887 2.45746739
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.1102536
[2,] -0.6076867
[3,] -0.2632637
[4,] 0.3898693
[5,] 1.1432267
>
> rowApply(tmp,sum)
[1] 2.1626925 0.5242953 1.6194310 1.6310400 5.2979174 1.5011609
[7] 0.3592625 -3.3991016 -0.7569451 -0.5668997
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 2 2 6 2 7 5 3 6 4 8
[2,] 10 8 8 1 1 9 9 8 7 10
[3,] 1 1 10 6 2 8 5 9 5 9
[4,] 3 5 4 10 6 3 7 5 8 1
[5,] 6 7 3 5 10 2 10 2 2 4
[6,] 4 10 1 8 9 1 6 4 9 6
[7,] 9 3 2 9 5 6 1 7 6 7
[8,] 8 9 7 3 3 7 4 3 3 2
[9,] 7 4 9 7 4 10 2 10 1 3
[10,] 5 6 5 4 8 4 8 1 10 5
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.1706176 -0.7237575 -1.1872203 0.6645426 -2.0134552 -1.3146356
[7] -1.5248654 4.3822386 2.6371035 0.1485844 0.1576035 4.5892211
[13] 3.8502669 -2.5183343 -3.0896627 1.1277828 4.7027287 1.4699591
[19] 1.0381268 -2.3885124
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.0168642
[2,] -0.8569618
[3,] -0.8439516
[4,] 1.0299648
[5,] 1.5171952
>
> rowApply(tmp,sum)
[1] 0.6755743 3.1438459 3.9061397 1.7073829 -0.5958458
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 1 3 17 19 6
[2,] 12 6 20 1 11
[3,] 16 7 10 3 5
[4,] 10 13 19 11 3
[5,] 17 12 1 9 2
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -2.0168642 0.2224631 0.8182595 -0.1840993 0.8877852 -0.8409517
[2,] -0.8569618 -0.5744543 -0.3154116 0.5392782 0.5228421 0.3672990
[3,] 1.0299648 1.4421049 0.2826949 1.4123591 -1.8664204 0.8406777
[4,] 1.5171952 -2.1941228 -1.0716890 0.1298130 -0.2529764 -0.6068062
[5,] -0.8439516 0.3802516 -0.9010742 -1.2328084 -1.3046857 -1.0748543
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] -0.7961304 1.6905830 -0.6505566 -0.5500736 0.7857762 0.6766244 1.5453485
[2,] 0.7483997 0.6679647 1.6277814 0.7998539 -0.8502972 1.3691360 1.0424317
[3,] -0.5781559 1.2961655 0.3793974 -0.7735734 0.3432949 0.9156419 0.9167826
[4,] -0.3816490 0.1841062 0.1734109 -0.5309789 -0.5520631 1.1516114 -0.1457013
[5,] -0.5173298 0.5434192 1.1070704 1.2033564 0.4308927 0.4762074 0.4914054
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] -0.1103862 -0.2154214 -0.36031252 1.0894236 -0.2460327 -1.30900192
[2,] -1.6893365 0.1480564 0.32907766 1.0415588 -0.7921507 0.29877741
[3,] 0.6165160 -1.1983861 0.16725657 -0.4838711 -0.0840068 -0.03845692
[4,] -1.1622488 0.3078703 0.97195623 1.9381260 1.3391299 1.31963799
[5,] -0.1728788 -2.1317820 0.01980485 1.1174913 1.2530194 0.76717028
[,20]
[1,] 0.2391413
[2,] -1.2799990
[3,] -0.7138461
[4,] -0.4272389
[5,] -0.2065698
>
>
> 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 : 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.23-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.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 col7
row1 -2.060812 0.5419591 0.7947344 -1.762201 -0.7836826 -0.5302393 -1.701972
col8 col9 col10 col11 col12 col13 col14
row1 -1.151992 -0.9927483 -1.146714 -0.9316902 -1.157848 1.451576 -1.012772
col15 col16 col17 col18 col19 col20
row1 -0.9392786 0.08072696 0.2606079 -0.3022257 1.438636 0.4289158
> tmp[,"col10"]
col10
row1 -1.1467143
row2 -0.5320416
row3 1.6569885
row4 0.7614206
row5 -1.3993743
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -2.0608122 0.5419591 0.7947344 -1.762201 -0.7836826 -0.5302393 -1.7019724
row5 -0.1315142 1.2112003 -0.6322505 -0.760803 0.3849357 1.2523686 0.9172455
col8 col9 col10 col11 col12 col13 col14
row1 -1.1519918 -0.9927483 -1.146714 -0.9316902 -1.1578476 1.451576 -1.0127725
row5 0.3246399 0.5452359 -1.399374 0.8555096 0.2542071 -1.102486 -0.2725145
col15 col16 col17 col18 col19 col20
row1 -0.9392786 0.08072696 0.26060791 -0.3022257 1.4386360 0.4289158
row5 -0.4177242 -1.16558387 0.04999565 1.0772396 0.7895975 -2.1957174
> tmp[,c("col6","col20")]
col6 col20
row1 -0.5302393 0.4289158
row2 1.1957119 0.7613334
row3 1.1638775 -0.1775947
row4 -1.8797016 0.3350354
row5 1.2523686 -2.1957174
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.5302393 0.4289158
row5 1.2523686 -2.1957174
>
>
>
>
> 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.41856 50.5113 48.97567 50.27292 50.18985 104.662 49.36239 51.08371
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.30651 48.19095 48.01626 51.27671 49.6207 51.6465 50.67404 50.63965
col17 col18 col19 col20
row1 50.21865 51.76646 49.83501 105.7922
> tmp[,"col10"]
col10
row1 48.19095
row2 30.70789
row3 29.32280
row4 30.64547
row5 50.15810
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.41856 50.51130 48.97567 50.27292 50.18985 104.6620 49.36239 51.08371
row5 49.45118 51.52912 49.75900 50.23198 50.71672 105.0728 50.89305 49.88697
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.30651 48.19095 48.01626 51.27671 49.62070 51.64650 50.67404 50.63965
row5 51.33522 50.15810 49.73891 49.69489 49.73613 51.62351 50.93348 51.68375
col17 col18 col19 col20
row1 50.21865 51.76646 49.83501 105.7922
row5 49.52754 51.31520 49.08752 102.8755
> tmp[,c("col6","col20")]
col6 col20
row1 104.66197 105.79220
row2 73.43755 74.99223
row3 75.58832 74.86159
row4 76.08133 74.61228
row5 105.07276 102.87554
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.6620 105.7922
row5 105.0728 102.8755
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.6620 105.7922
row5 105.0728 102.8755
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.6067693
[2,] -1.7901615
[3,] 0.5994449
[4,] 0.5858946
[5,] 1.5340114
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.2793659 0.1885631
[2,] 1.8333861 1.9651770
[3,] -0.1279201 0.7585252
[4,] 1.0091629 -1.2239301
[5,] 0.3903371 0.5699616
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.7756260 -1.0321263
[2,] -0.4776066 0.9057566
[3,] 0.6038971 1.1280468
[4,] 0.3208493 0.6725188
[5,] -0.6962070 1.5089823
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.775626
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.7756260
[2,] -0.4776066
>
>
>
> 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.8982526 -2.3227550 0.3627631 -0.3832597 0.05022237 0.4076118
row1 1.8995254 0.4903452 -1.0475521 -0.5596075 0.27725939 0.9915916
[,7] [,8] [,9] [,10] [,11] [,12]
row3 -0.01821468 0.96809674 -0.4085977 -0.8966744 1.1111003 0.0037578
row1 -0.57838908 0.09040787 0.5667114 -0.2434325 -0.9966375 -1.2644725
[,13] [,14] [,15] [,16] [,17] [,18]
row3 -1.3132159 0.1470268 0.264256631 -1.838493 -0.4114755 0.1965428
row1 0.4317639 -0.9567519 0.004107761 -1.068807 -0.9228453 -1.1199343
[,19] [,20]
row3 0.5700999 1.2782633
row1 0.3743560 -0.5846863
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6]
row2 0.7645857 -0.1527168 -0.0004027672 0.7166558 0.5843739 -0.8071211
[,7] [,8] [,9] [,10]
row2 0.6860186 -2.416872 -1.743794 -0.2814909
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row5 -0.5873643 -0.8453065 -0.2568638 -0.04981567 -0.2069859 -0.6494645
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row5 -1.848609 1.078152 0.9606202 -0.7451191 0.08429642 -1.124095 0.6050959
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row5 0.554477 -0.5390165 0.8885835 -0.09610782 -0.8338899 -0.2092099 0.7325917
>
>
> 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: 0x60be3c79efb0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2367425e6681df"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2367426740a3ec"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2367422f7e27f"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM23674250f97898"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2367426f4d55ee"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM23674230207255"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2367429cccac0"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM23674214ae6b92"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM23674248d5c778"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM23674275075810"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM23674236fde95"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2367427b02793c"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM236742d4767c2"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM236742403d7c09"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2367422e418c25"
>
>
> ### 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: 0x60be3b48aa90>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x60be3b48aa90>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x60be3b48aa90>
> rowMedians(tmp)
[1] -0.120233126 -0.190356821 -0.423504915 0.654179865 0.371380727
[6] -0.218433985 -0.341096606 -0.335476691 0.113267075 0.007310258
[11] 0.103223564 -0.053475318 0.224270275 -0.865258569 -0.078069565
[16] 0.082592811 -0.377604860 0.053039640 -0.364298561 -0.269559975
[21] 0.192190887 0.304583998 0.246959982 -0.428234850 -0.099620646
[26] 0.583472973 -0.076433091 -0.476983588 0.324855349 0.018231646
[31] -0.058404066 -0.506496516 0.007869126 -0.111806382 -0.028986203
[36] -0.526893316 0.409881991 0.016864019 -0.011553257 0.620145837
[41] -0.312329573 -0.295734227 -0.076050709 -0.101071748 0.387627023
[46] -0.127941665 -0.601314476 -0.699708900 -0.415142235 -0.539296985
[51] 0.742029648 0.112631111 -0.239759503 -0.383086291 -0.157760622
[56] 0.041846839 -0.048871364 0.037339546 -0.077800499 0.555297995
[61] -0.525649514 -0.006894284 0.182468106 -0.409640410 -0.162558573
[66] 0.115965733 0.099126660 0.072489069 -0.020865727 0.557704055
[71] -0.456368092 0.076615753 -0.291734691 -0.104005939 -0.147980928
[76] 0.411719843 -0.110309209 0.185744289 -0.101544668 -0.435088121
[81] -0.559522959 0.052760302 -0.006006650 -0.361404826 -0.030056395
[86] 0.409017258 0.620200162 0.386101182 0.011724172 -0.311761641
[91] -0.055894289 -0.469500085 -0.013397372 -0.231054490 -0.042751765
[96] 0.851193549 -0.297584568 0.236071574 0.165298085 0.061608108
[101] 0.182966351 0.464116366 0.880789356 0.355961630 -0.252009497
[106] 0.180397053 -0.039715876 -0.185896162 0.020004565 0.079069419
[111] -0.407939107 -0.074611092 -0.052913061 0.063674293 -0.385865459
[116] -0.016125675 0.356412091 -0.091215061 0.272632972 0.148757727
[121] -0.393069550 0.390691312 0.501339795 -0.045535683 0.591142774
[126] -0.011306698 0.427457855 0.268548331 0.388572418 0.828606443
[131] 0.123396513 0.233587656 -0.315655169 0.086737651 -0.176094679
[136] -0.227335638 -0.199157243 0.290814427 0.386245931 0.270925352
[141] 0.311455502 0.179307116 0.065929036 0.531185842 0.077083703
[146] -0.501597366 0.421618957 -0.121958815 -0.189461936 -0.187907877
[151] -0.091088225 -0.525737825 -1.099643313 -0.010463169 -0.243976269
[156] -0.217724746 -0.145725282 0.189038836 -0.270294996 0.336330229
[161] 0.130246921 -0.089170277 0.108574025 0.200746823 0.333491121
[166] -0.016078606 -0.086241846 0.347707391 -0.238296951 -0.116645758
[171] 0.391762727 -0.552167057 -0.173222307 0.245625244 -0.108149921
[176] 0.361561529 0.186478484 -0.001427273 0.352820677 -0.075358958
[181] 0.342233969 -0.198654521 -0.051570393 -0.281828340 0.465890489
[186] -0.643384782 -0.320261323 -0.026616158 -0.259467101 0.117848455
[191] 0.130782155 0.056971940 0.151695655 0.093676576 0.594523272
[196] -0.007043984 0.121568956 -0.491998023 -0.245228927 -0.322146227
[201] -0.089792553 -0.039000248 -0.125859556 0.276160363 0.585696441
[206] 0.039492459 0.128099932 0.192927150 0.309218985 -0.128303985
[211] -0.129741352 0.232972163 0.395970194 -0.565664828 0.086841946
[216] -0.107800593 -0.050804302 -0.215014259 -0.315349279 -0.459312692
[221] 0.117615385 -0.017789781 0.205026323 -0.076005946 0.702427789
[226] -0.084256410 -0.573200497 -0.337426800 0.230080833 -0.405547557
>
> proc.time()
user system elapsed
1.351 1.468 2.807
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences"
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: 0x57045f127ff0>
> .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: 0x57045f127ff0>
> .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: 0x57045f127ff0>
> .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: 0x57045f127ff0>
> 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: 0x57045edd3710>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57045edd3710>
> .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: 0x57045edd3710>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57045edd3710>
> .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: 0x57045edd3710>
> 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: 0x57045f1373f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57045f1373f0>
> .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: 0x57045f1373f0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x57045f1373f0>
> .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: 0x57045f1373f0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x57045f1373f0>
> .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: 0x57045f1373f0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x57045f1373f0>
> .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: 0x57045f1373f0>
> 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: 0x57045e86e8c0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x57045e86e8c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57045e86e8c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57045e86e8c0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile23699d3aaa9dea" "BufferedMatrixFile23699d4dd48e51"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile23699d3aaa9dea" "BufferedMatrixFile23699d4dd48e51"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x57045e59ae30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57045e59ae30>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x57045e59ae30>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x57045e59ae30>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x57045e59ae30>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x57045e59ae30>
> .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: 0x57045f6f6790>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57045f6f6790>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x57045f6f6790>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x57045f6f6790>
> 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: 0x57045eae1860>
> .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: 0x57045eae1860>
> rm(P)
>
> proc.time()
user system elapsed
0.257 0.054 0.298
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences"
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.254 0.043 0.286