| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-03-20 11:34 -0400 (Fri, 20 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" | 4862 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2026-03-01 r89506) -- "Unsuffered Consequences" | 4064 |
| Click on any hostname to see more info about the system (e.g. compilers) (*) as reported by 'uname -p', except on Windows and Mac OS X | ||||
| Package 257/2368 | 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 | ERROR | ERROR | skipped | skipped | |||||||||
| 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-19 21:43:32 -0400 (Thu, 19 Mar 2026) |
| EndedAt: 2026-03-19 21:43:57 -0400 (Thu, 19 Mar 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.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-20 01:43:32 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.249 0.050 0.287
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] "Thu Mar 19 21:43:47 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] "Thu Mar 19 21:43:47 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: 0x5dd22f74d4f0>
>
>
>
> 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] "Thu Mar 19 21:43:47 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] "Thu Mar 19 21:43:48 2026"
>
> ColMode(tmp2)
<pointer: 0x5dd22f74d4f0>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 99.740918 -1.1840538 -1.8388565 -0.05684221
[2,] -1.393324 0.1069898 -1.5435397 -0.68646544
[3,] -1.513431 0.9403176 -0.1444918 -1.18531076
[4,] 1.094722 -0.5316338 -0.8110650 -0.27020280
> 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,] 99.740918 1.1840538 1.8388565 0.05684221
[2,] 1.393324 0.1069898 1.5435397 0.68646544
[3,] 1.513431 0.9403176 0.1444918 1.18531076
[4,] 1.094722 0.5316338 0.8110650 0.27020280
> 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,] 9.987037 1.0881424 1.3560444 0.2384160
[2,] 1.180391 0.3270929 1.2423927 0.8285321
[3,] 1.230216 0.9696997 0.3801208 1.0887198
[4,] 1.046289 0.7291322 0.9005915 0.5198104
>
> 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,] 224.61129 37.06548 40.39930 27.44100
[2,] 38.19724 28.37792 38.96747 33.97179
[3,] 38.81559 35.63732 28.94570 37.07251
[4,] 36.55762 32.82296 34.81698 30.46831
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5dd2300fdaa0>
> exp(tmp5)
<pointer: 0x5dd2300fdaa0>
> log(tmp5,2)
<pointer: 0x5dd2300fdaa0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.499
> Min(tmp5)
[1] 53.74114
> mean(tmp5)
[1] 72.50319
> Sum(tmp5)
[1] 14500.64
> Var(tmp5)
[1] 858.4153
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.28782 67.77367 68.51108 69.75800 75.97490 67.87413 70.93273 75.01948
[9] 70.39432 68.50582
> rowSums(tmp5)
[1] 1805.756 1355.473 1370.222 1395.160 1519.498 1357.483 1418.655 1500.390
[9] 1407.886 1370.116
> rowVars(tmp5)
[1] 7941.27419 71.88669 59.94235 80.28850 29.89725 77.64649
[7] 79.58401 52.58268 87.63622 62.83219
> rowSd(tmp5)
[1] 89.113827 8.478602 7.742244 8.960385 5.467838 8.811725 8.920987
[8] 7.251391 9.361422 7.926676
> rowMax(tmp5)
[1] 467.49898 82.29614 80.78957 83.64824 86.11158 83.23825 86.20367
[8] 85.80061 90.73370 86.31682
> rowMin(tmp5)
[1] 57.11485 57.36058 53.74114 54.33158 67.38849 53.80980 58.23323 62.35951
[9] 57.54745 57.74766
>
> colMeans(tmp5)
[1] 113.60655 70.87097 74.07383 71.21618 70.17962 64.68399 68.46996
[8] 74.86641 68.04792 70.52545 71.68838 71.17249 70.23499 71.88884
[15] 73.42298 69.57134 67.96108 70.59640 67.43980 69.54668
> colSums(tmp5)
[1] 1136.0655 708.7097 740.7383 712.1618 701.7962 646.8399 684.6996
[8] 748.6641 680.4792 705.2545 716.8838 711.7249 702.3499 718.8884
[15] 734.2298 695.7134 679.6108 705.9640 674.3980 695.4668
> colVars(tmp5)
[1] 15479.63537 45.07711 76.83256 80.28587 104.47563 31.75303
[7] 27.15865 87.70741 126.47684 75.96603 67.07294 85.15116
[13] 56.42444 89.62496 87.52943 59.03411 42.04719 117.71105
[19] 66.91971 79.77708
> colSd(tmp5)
[1] 124.417183 6.713949 8.765418 8.960238 10.221332 5.634983
[7] 5.211396 9.365224 11.246192 8.715849 8.189807 9.227739
[13] 7.511620 9.467046 9.355716 7.683366 6.484380 10.849472
[19] 8.180447 8.931802
> colMax(tmp5)
[1] 467.49898 79.25750 84.08585 82.80712 84.57153 73.76343 74.41774
[8] 86.20367 85.21252 83.64824 85.69451 86.31682 82.79544 90.73370
[15] 87.69220 80.66421 82.29614 86.11158 81.07528 81.43394
> colMin(tmp5)
[1] 68.10576 59.06492 57.74198 57.11485 54.33158 55.65822 58.19179 60.09187
[9] 53.74114 58.23323 58.82783 55.86776 58.19569 62.38584 59.48418 57.74766
[17] 57.54745 57.75827 56.53363 57.45543
>
>
> ### 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.28782 67.77367 68.51108 69.75800 75.97490 67.87413 70.93273 NA
[9] 70.39432 68.50582
> rowSums(tmp5)
[1] 1805.756 1355.473 1370.222 1395.160 1519.498 1357.483 1418.655 NA
[9] 1407.886 1370.116
> rowVars(tmp5)
[1] 7941.27419 71.88669 59.94235 80.28850 29.89725 77.64649
[7] 79.58401 49.72989 87.63622 62.83219
> rowSd(tmp5)
[1] 89.113827 8.478602 7.742244 8.960385 5.467838 8.811725 8.920987
[8] 7.051943 9.361422 7.926676
> rowMax(tmp5)
[1] 467.49898 82.29614 80.78957 83.64824 86.11158 83.23825 86.20367
[8] NA 90.73370 86.31682
> rowMin(tmp5)
[1] 57.11485 57.36058 53.74114 54.33158 67.38849 53.80980 58.23323 NA
[9] 57.54745 57.74766
>
> colMeans(tmp5)
[1] 113.60655 70.87097 74.07383 71.21618 70.17962 64.68399 68.46996
[8] 74.86641 NA 70.52545 71.68838 71.17249 70.23499 71.88884
[15] 73.42298 69.57134 67.96108 70.59640 67.43980 69.54668
> colSums(tmp5)
[1] 1136.0655 708.7097 740.7383 712.1618 701.7962 646.8399 684.6996
[8] 748.6641 NA 705.2545 716.8838 711.7249 702.3499 718.8884
[15] 734.2298 695.7134 679.6108 705.9640 674.3980 695.4668
> colVars(tmp5)
[1] 15479.63537 45.07711 76.83256 80.28587 104.47563 31.75303
[7] 27.15865 87.70741 NA 75.96603 67.07294 85.15116
[13] 56.42444 89.62496 87.52943 59.03411 42.04719 117.71105
[19] 66.91971 79.77708
> colSd(tmp5)
[1] 124.417183 6.713949 8.765418 8.960238 10.221332 5.634983
[7] 5.211396 9.365224 NA 8.715849 8.189807 9.227739
[13] 7.511620 9.467046 9.355716 7.683366 6.484380 10.849472
[19] 8.180447 8.931802
> colMax(tmp5)
[1] 467.49898 79.25750 84.08585 82.80712 84.57153 73.76343 74.41774
[8] 86.20367 NA 83.64824 85.69451 86.31682 82.79544 90.73370
[15] 87.69220 80.66421 82.29614 86.11158 81.07528 81.43394
> colMin(tmp5)
[1] 68.10576 59.06492 57.74198 57.11485 54.33158 55.65822 58.19179 60.09187
[9] NA 58.23323 58.82783 55.86776 58.19569 62.38584 59.48418 57.74766
[17] 57.54745 57.75827 56.53363 57.45543
>
> Max(tmp5,na.rm=TRUE)
[1] 467.499
> Min(tmp5,na.rm=TRUE)
[1] 53.74114
> mean(tmp5,na.rm=TRUE)
[1] 72.54048
> Sum(tmp5,na.rm=TRUE)
[1] 14435.56
> Var(tmp5,na.rm=TRUE)
[1] 862.4712
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.28782 67.77367 68.51108 69.75800 75.97490 67.87413 70.93273 75.54245
[9] 70.39432 68.50582
> rowSums(tmp5,na.rm=TRUE)
[1] 1805.756 1355.473 1370.222 1395.160 1519.498 1357.483 1418.655 1435.307
[9] 1407.886 1370.116
> rowVars(tmp5,na.rm=TRUE)
[1] 7941.27419 71.88669 59.94235 80.28850 29.89725 77.64649
[7] 79.58401 49.72989 87.63622 62.83219
> rowSd(tmp5,na.rm=TRUE)
[1] 89.113827 8.478602 7.742244 8.960385 5.467838 8.811725 8.920987
[8] 7.051943 9.361422 7.926676
> rowMax(tmp5,na.rm=TRUE)
[1] 467.49898 82.29614 80.78957 83.64824 86.11158 83.23825 86.20367
[8] 85.80061 90.73370 86.31682
> rowMin(tmp5,na.rm=TRUE)
[1] 57.11485 57.36058 53.74114 54.33158 67.38849 53.80980 58.23323 62.35951
[9] 57.54745 57.74766
>
> colMeans(tmp5,na.rm=TRUE)
[1] 113.60655 70.87097 74.07383 71.21618 70.17962 64.68399 68.46996
[8] 74.86641 68.37737 70.52545 71.68838 71.17249 70.23499 71.88884
[15] 73.42298 69.57134 67.96108 70.59640 67.43980 69.54668
> colSums(tmp5,na.rm=TRUE)
[1] 1136.0655 708.7097 740.7383 712.1618 701.7962 646.8399 684.6996
[8] 748.6641 615.3964 705.2545 716.8838 711.7249 702.3499 718.8884
[15] 734.2298 695.7134 679.6108 705.9640 674.3980 695.4668
> colVars(tmp5,na.rm=TRUE)
[1] 15479.63537 45.07711 76.83256 80.28587 104.47563 31.75303
[7] 27.15865 87.70741 141.06540 75.96603 67.07294 85.15116
[13] 56.42444 89.62496 87.52943 59.03411 42.04719 117.71105
[19] 66.91971 79.77708
> colSd(tmp5,na.rm=TRUE)
[1] 124.417183 6.713949 8.765418 8.960238 10.221332 5.634983
[7] 5.211396 9.365224 11.877096 8.715849 8.189807 9.227739
[13] 7.511620 9.467046 9.355716 7.683366 6.484380 10.849472
[19] 8.180447 8.931802
> colMax(tmp5,na.rm=TRUE)
[1] 467.49898 79.25750 84.08585 82.80712 84.57153 73.76343 74.41774
[8] 86.20367 85.21252 83.64824 85.69451 86.31682 82.79544 90.73370
[15] 87.69220 80.66421 82.29614 86.11158 81.07528 81.43394
> colMin(tmp5,na.rm=TRUE)
[1] 68.10576 59.06492 57.74198 57.11485 54.33158 55.65822 58.19179 60.09187
[9] 53.74114 58.23323 58.82783 55.86776 58.19569 62.38584 59.48418 57.74766
[17] 57.54745 57.75827 56.53363 57.45543
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.28782 67.77367 68.51108 69.75800 75.97490 67.87413 70.93273 NaN
[9] 70.39432 68.50582
> rowSums(tmp5,na.rm=TRUE)
[1] 1805.756 1355.473 1370.222 1395.160 1519.498 1357.483 1418.655 0.000
[9] 1407.886 1370.116
> rowVars(tmp5,na.rm=TRUE)
[1] 7941.27419 71.88669 59.94235 80.28850 29.89725 77.64649
[7] 79.58401 NA 87.63622 62.83219
> rowSd(tmp5,na.rm=TRUE)
[1] 89.113827 8.478602 7.742244 8.960385 5.467838 8.811725 8.920987
[8] NA 9.361422 7.926676
> rowMax(tmp5,na.rm=TRUE)
[1] 467.49898 82.29614 80.78957 83.64824 86.11158 83.23825 86.20367
[8] NA 90.73370 86.31682
> rowMin(tmp5,na.rm=TRUE)
[1] 57.11485 57.36058 53.74114 54.33158 67.38849 53.80980 58.23323 NA
[9] 57.54745 57.74766
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 118.62243 70.82079 73.45341 70.54674 68.58052 64.94226 67.85972
[8] 73.70868 NaN 69.85126 70.13214 70.77578 70.76621 72.35808
[15] 72.45202 69.32759 67.64018 68.90705 66.44975 68.90017
> colSums(tmp5,na.rm=TRUE)
[1] 1067.6019 637.3871 661.0807 634.9206 617.2247 584.4804 610.7375
[8] 663.3781 0.0000 628.6613 631.1893 636.9820 636.8959 651.2227
[15] 652.0682 623.9483 608.7616 620.1634 598.0477 620.1015
> colVars(tmp5,na.rm=TRUE)
[1] 17131.54999 50.68343 82.10629 85.27982 88.76743 34.97172
[7] 26.36396 83.59180 NA 80.34821 48.21101 94.02459
[13] 60.30272 98.35100 87.86455 65.74494 46.14458 100.31827
[19] 64.25724 85.04694
> colSd(tmp5,na.rm=TRUE)
[1] 130.887547 7.119229 9.061252 9.234707 9.421647 5.913689
[7] 5.134585 9.142855 NA 8.963717 6.943415 9.696628
[13] 7.765483 9.917207 9.373609 8.108325 6.792980 10.015901
[19] 8.016061 9.222090
> colMax(tmp5,na.rm=TRUE)
[1] 467.49898 79.25750 84.08585 82.80712 83.23825 73.76343 74.41774
[8] 86.20367 -Inf 83.64824 79.82127 86.31682 82.79544 90.73370
[15] 87.69220 80.66421 82.29614 86.11158 81.07528 81.43394
> colMin(tmp5,na.rm=TRUE)
[1] 68.10576 59.06492 57.74198 57.11485 54.33158 55.65822 58.19179 60.09187
[9] Inf 58.23323 58.82783 55.86776 58.19569 62.38584 59.48418 57.74766
[17] 57.54745 57.75827 56.53363 57.45543
>
>
>
>
> 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] 232.3139 236.4397 242.8362 161.7310 178.4381 237.9544 265.1389 302.5195
[9] 219.7610 328.9418
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 232.3139 236.4397 242.8362 161.7310 178.4381 237.9544 265.1389 302.5195
[9] 219.7610 328.9418
>
>
>
> 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.842171e-14 1.421085e-14 -4.263256e-14 4.263256e-14 3.979039e-13
[6] 1.136868e-13 -5.684342e-14 -2.842171e-14 0.000000e+00 -5.684342e-14
[11] 2.842171e-14 -8.526513e-14 5.684342e-14 -1.989520e-13 1.705303e-13
[16] 1.278977e-13 -1.136868e-13 -5.684342e-14 -5.684342e-14 2.842171e-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)
+ }
3 12
6 17
8 6
1 7
8 5
9 14
6 14
8 12
9 17
8 8
9 13
6 7
9 20
2 17
3 11
9 1
6 7
4 8
6 7
2 19
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.235653
> Min(tmp)
[1] -1.82759
> mean(tmp)
[1] 0.06306266
> Sum(tmp)
[1] 6.306266
> Var(tmp)
[1] 0.7907601
>
> rowMeans(tmp)
[1] 0.06306266
> rowSums(tmp)
[1] 6.306266
> rowVars(tmp)
[1] 0.7907601
> rowSd(tmp)
[1] 0.8892469
> rowMax(tmp)
[1] 2.235653
> rowMin(tmp)
[1] -1.82759
>
> colMeans(tmp)
[1] 0.799050817 -0.428837112 0.944657857 0.173569063 -0.403151551
[6] -0.630210245 -0.888610665 2.153608446 -1.269750034 0.421381630
[11] -0.135691499 0.317153255 1.044317483 -1.304317526 2.235653118
[16] 1.037528631 0.280329285 0.047897974 -0.154627197 1.572633968
[21] 0.257894509 -0.379728727 -1.827589722 -0.097674411 -0.385374630
[26] 0.943368395 0.027798782 0.656195213 1.038971669 -0.036617359
[31] 1.771600231 -0.643725609 -0.326290478 -0.610555507 -0.330018140
[36] 1.999058771 -0.516439034 0.174297402 0.269784732 -0.405107708
[41] 0.801220291 2.044016304 0.654517878 0.354348917 -0.925628549
[46] -1.240704498 -0.632408099 0.130125071 -0.411060718 0.127352405
[51] 0.896008155 -0.695590054 0.621762351 0.212657142 0.408978126
[56] -1.412509537 -0.142484781 0.162674365 0.074119713 -0.435909801
[61] -0.899030009 -0.484336997 1.434895045 0.898131194 -0.381711923
[66] -0.037503364 -0.588969272 -0.725655672 -0.213508411 -0.139076853
[71] 1.077200193 -0.381852670 -0.232783958 -0.406438960 0.341984819
[76] -0.620249523 0.410442910 -0.933081137 1.735681648 -0.666150433
[81] -0.661627960 0.390220629 0.992495872 -1.582037305 0.644360780
[86] -0.709433454 0.281154096 0.017079097 -1.025727227 0.008471922
[91] -1.031733402 0.512538626 0.381741818 1.526494790 0.971779567
[96] -1.722137273 -1.626522226 0.006688439 0.261100359 1.499453394
> colSums(tmp)
[1] 0.799050817 -0.428837112 0.944657857 0.173569063 -0.403151551
[6] -0.630210245 -0.888610665 2.153608446 -1.269750034 0.421381630
[11] -0.135691499 0.317153255 1.044317483 -1.304317526 2.235653118
[16] 1.037528631 0.280329285 0.047897974 -0.154627197 1.572633968
[21] 0.257894509 -0.379728727 -1.827589722 -0.097674411 -0.385374630
[26] 0.943368395 0.027798782 0.656195213 1.038971669 -0.036617359
[31] 1.771600231 -0.643725609 -0.326290478 -0.610555507 -0.330018140
[36] 1.999058771 -0.516439034 0.174297402 0.269784732 -0.405107708
[41] 0.801220291 2.044016304 0.654517878 0.354348917 -0.925628549
[46] -1.240704498 -0.632408099 0.130125071 -0.411060718 0.127352405
[51] 0.896008155 -0.695590054 0.621762351 0.212657142 0.408978126
[56] -1.412509537 -0.142484781 0.162674365 0.074119713 -0.435909801
[61] -0.899030009 -0.484336997 1.434895045 0.898131194 -0.381711923
[66] -0.037503364 -0.588969272 -0.725655672 -0.213508411 -0.139076853
[71] 1.077200193 -0.381852670 -0.232783958 -0.406438960 0.341984819
[76] -0.620249523 0.410442910 -0.933081137 1.735681648 -0.666150433
[81] -0.661627960 0.390220629 0.992495872 -1.582037305 0.644360780
[86] -0.709433454 0.281154096 0.017079097 -1.025727227 0.008471922
[91] -1.031733402 0.512538626 0.381741818 1.526494790 0.971779567
[96] -1.722137273 -1.626522226 0.006688439 0.261100359 1.499453394
> 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.799050817 -0.428837112 0.944657857 0.173569063 -0.403151551
[6] -0.630210245 -0.888610665 2.153608446 -1.269750034 0.421381630
[11] -0.135691499 0.317153255 1.044317483 -1.304317526 2.235653118
[16] 1.037528631 0.280329285 0.047897974 -0.154627197 1.572633968
[21] 0.257894509 -0.379728727 -1.827589722 -0.097674411 -0.385374630
[26] 0.943368395 0.027798782 0.656195213 1.038971669 -0.036617359
[31] 1.771600231 -0.643725609 -0.326290478 -0.610555507 -0.330018140
[36] 1.999058771 -0.516439034 0.174297402 0.269784732 -0.405107708
[41] 0.801220291 2.044016304 0.654517878 0.354348917 -0.925628549
[46] -1.240704498 -0.632408099 0.130125071 -0.411060718 0.127352405
[51] 0.896008155 -0.695590054 0.621762351 0.212657142 0.408978126
[56] -1.412509537 -0.142484781 0.162674365 0.074119713 -0.435909801
[61] -0.899030009 -0.484336997 1.434895045 0.898131194 -0.381711923
[66] -0.037503364 -0.588969272 -0.725655672 -0.213508411 -0.139076853
[71] 1.077200193 -0.381852670 -0.232783958 -0.406438960 0.341984819
[76] -0.620249523 0.410442910 -0.933081137 1.735681648 -0.666150433
[81] -0.661627960 0.390220629 0.992495872 -1.582037305 0.644360780
[86] -0.709433454 0.281154096 0.017079097 -1.025727227 0.008471922
[91] -1.031733402 0.512538626 0.381741818 1.526494790 0.971779567
[96] -1.722137273 -1.626522226 0.006688439 0.261100359 1.499453394
> colMin(tmp)
[1] 0.799050817 -0.428837112 0.944657857 0.173569063 -0.403151551
[6] -0.630210245 -0.888610665 2.153608446 -1.269750034 0.421381630
[11] -0.135691499 0.317153255 1.044317483 -1.304317526 2.235653118
[16] 1.037528631 0.280329285 0.047897974 -0.154627197 1.572633968
[21] 0.257894509 -0.379728727 -1.827589722 -0.097674411 -0.385374630
[26] 0.943368395 0.027798782 0.656195213 1.038971669 -0.036617359
[31] 1.771600231 -0.643725609 -0.326290478 -0.610555507 -0.330018140
[36] 1.999058771 -0.516439034 0.174297402 0.269784732 -0.405107708
[41] 0.801220291 2.044016304 0.654517878 0.354348917 -0.925628549
[46] -1.240704498 -0.632408099 0.130125071 -0.411060718 0.127352405
[51] 0.896008155 -0.695590054 0.621762351 0.212657142 0.408978126
[56] -1.412509537 -0.142484781 0.162674365 0.074119713 -0.435909801
[61] -0.899030009 -0.484336997 1.434895045 0.898131194 -0.381711923
[66] -0.037503364 -0.588969272 -0.725655672 -0.213508411 -0.139076853
[71] 1.077200193 -0.381852670 -0.232783958 -0.406438960 0.341984819
[76] -0.620249523 0.410442910 -0.933081137 1.735681648 -0.666150433
[81] -0.661627960 0.390220629 0.992495872 -1.582037305 0.644360780
[86] -0.709433454 0.281154096 0.017079097 -1.025727227 0.008471922
[91] -1.031733402 0.512538626 0.381741818 1.526494790 0.971779567
[96] -1.722137273 -1.626522226 0.006688439 0.261100359 1.499453394
> colMedians(tmp)
[1] 0.799050817 -0.428837112 0.944657857 0.173569063 -0.403151551
[6] -0.630210245 -0.888610665 2.153608446 -1.269750034 0.421381630
[11] -0.135691499 0.317153255 1.044317483 -1.304317526 2.235653118
[16] 1.037528631 0.280329285 0.047897974 -0.154627197 1.572633968
[21] 0.257894509 -0.379728727 -1.827589722 -0.097674411 -0.385374630
[26] 0.943368395 0.027798782 0.656195213 1.038971669 -0.036617359
[31] 1.771600231 -0.643725609 -0.326290478 -0.610555507 -0.330018140
[36] 1.999058771 -0.516439034 0.174297402 0.269784732 -0.405107708
[41] 0.801220291 2.044016304 0.654517878 0.354348917 -0.925628549
[46] -1.240704498 -0.632408099 0.130125071 -0.411060718 0.127352405
[51] 0.896008155 -0.695590054 0.621762351 0.212657142 0.408978126
[56] -1.412509537 -0.142484781 0.162674365 0.074119713 -0.435909801
[61] -0.899030009 -0.484336997 1.434895045 0.898131194 -0.381711923
[66] -0.037503364 -0.588969272 -0.725655672 -0.213508411 -0.139076853
[71] 1.077200193 -0.381852670 -0.232783958 -0.406438960 0.341984819
[76] -0.620249523 0.410442910 -0.933081137 1.735681648 -0.666150433
[81] -0.661627960 0.390220629 0.992495872 -1.582037305 0.644360780
[86] -0.709433454 0.281154096 0.017079097 -1.025727227 0.008471922
[91] -1.031733402 0.512538626 0.381741818 1.526494790 0.971779567
[96] -1.722137273 -1.626522226 0.006688439 0.261100359 1.499453394
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.7990508 -0.4288371 0.9446579 0.1735691 -0.4031516 -0.6302102 -0.8886107
[2,] 0.7990508 -0.4288371 0.9446579 0.1735691 -0.4031516 -0.6302102 -0.8886107
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 2.153608 -1.26975 0.4213816 -0.1356915 0.3171533 1.044317 -1.304318
[2,] 2.153608 -1.26975 0.4213816 -0.1356915 0.3171533 1.044317 -1.304318
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 2.235653 1.037529 0.2803293 0.04789797 -0.1546272 1.572634 0.2578945
[2,] 2.235653 1.037529 0.2803293 0.04789797 -0.1546272 1.572634 0.2578945
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.3797287 -1.82759 -0.09767441 -0.3853746 0.9433684 0.02779878 0.6561952
[2,] -0.3797287 -1.82759 -0.09767441 -0.3853746 0.9433684 0.02779878 0.6561952
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 1.038972 -0.03661736 1.7716 -0.6437256 -0.3262905 -0.6105555 -0.3300181
[2,] 1.038972 -0.03661736 1.7716 -0.6437256 -0.3262905 -0.6105555 -0.3300181
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 1.999059 -0.516439 0.1742974 0.2697847 -0.4051077 0.8012203 2.044016
[2,] 1.999059 -0.516439 0.1742974 0.2697847 -0.4051077 0.8012203 2.044016
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.6545179 0.3543489 -0.9256285 -1.240704 -0.6324081 0.1301251 -0.4110607
[2,] 0.6545179 0.3543489 -0.9256285 -1.240704 -0.6324081 0.1301251 -0.4110607
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.1273524 0.8960082 -0.6955901 0.6217624 0.2126571 0.4089781 -1.41251
[2,] 0.1273524 0.8960082 -0.6955901 0.6217624 0.2126571 0.4089781 -1.41251
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.1424848 0.1626744 0.07411971 -0.4359098 -0.89903 -0.484337 1.434895
[2,] -0.1424848 0.1626744 0.07411971 -0.4359098 -0.89903 -0.484337 1.434895
[,64] [,65] [,66] [,67] [,68] [,69]
[1,] 0.8981312 -0.3817119 -0.03750336 -0.5889693 -0.7256557 -0.2135084
[2,] 0.8981312 -0.3817119 -0.03750336 -0.5889693 -0.7256557 -0.2135084
[,70] [,71] [,72] [,73] [,74] [,75] [,76]
[1,] -0.1390769 1.0772 -0.3818527 -0.232784 -0.406439 0.3419848 -0.6202495
[2,] -0.1390769 1.0772 -0.3818527 -0.232784 -0.406439 0.3419848 -0.6202495
[,77] [,78] [,79] [,80] [,81] [,82] [,83]
[1,] 0.4104429 -0.9330811 1.735682 -0.6661504 -0.661628 0.3902206 0.9924959
[2,] 0.4104429 -0.9330811 1.735682 -0.6661504 -0.661628 0.3902206 0.9924959
[,84] [,85] [,86] [,87] [,88] [,89] [,90]
[1,] -1.582037 0.6443608 -0.7094335 0.2811541 0.0170791 -1.025727 0.008471922
[2,] -1.582037 0.6443608 -0.7094335 0.2811541 0.0170791 -1.025727 0.008471922
[,91] [,92] [,93] [,94] [,95] [,96] [,97]
[1,] -1.031733 0.5125386 0.3817418 1.526495 0.9717796 -1.722137 -1.626522
[2,] -1.031733 0.5125386 0.3817418 1.526495 0.9717796 -1.722137 -1.626522
[,98] [,99] [,100]
[1,] 0.006688439 0.2611004 1.499453
[2,] 0.006688439 0.2611004 1.499453
>
>
> Max(tmp2)
[1] 2.350213
> Min(tmp2)
[1] -3.041715
> mean(tmp2)
[1] 0.08585765
> Sum(tmp2)
[1] 8.585765
> Var(tmp2)
[1] 1.218886
>
> rowMeans(tmp2)
[1] -0.26628786 0.23887354 -0.38480677 1.53212024 -0.03229616 1.22813353
[7] -0.89675722 1.03180624 0.53404926 0.20876371 0.21220061 0.15164870
[13] 0.88136657 -3.04171467 0.62567551 0.05368464 0.33343681 -0.42230702
[19] 0.24576353 -0.06567287 -0.62033763 -2.44004439 -1.00572665 0.80059776
[25] -0.94571150 -0.15616587 1.68737459 -0.57524904 0.30501947 -1.57887518
[31] -0.29771317 0.10089503 1.81935387 0.14709082 1.72374330 2.35021299
[37] 0.03992896 -1.14471990 -0.31631411 1.20847826 -0.03037478 -1.27081081
[43] -1.15769322 0.07853368 2.18392639 1.60089313 -2.44126566 1.24214244
[49] -0.70859355 -1.20575210 1.14140371 0.46546977 1.78076982 1.15780828
[55] 0.58404272 -0.22796287 1.16346935 -0.34040761 -0.87341210 0.26733362
[61] 0.36336356 -0.69616436 1.57780114 0.33037090 0.39315219 1.81385811
[67] -0.31943427 -0.10028423 1.58583787 -0.33136112 -0.36503328 -0.95953839
[73] 0.10951494 -0.57594875 -1.17371663 -0.61554428 -0.01447888 0.78982250
[79] -0.20267827 0.93693126 -1.51771336 0.69977310 -0.49857848 1.27768974
[85] 1.81600810 -0.61691858 -1.65087643 0.62167974 -1.50935076 -0.28808604
[91] -0.46577395 0.32399397 0.39094403 -1.48417475 2.21003288 -2.73103105
[97] 1.38679365 -0.23344467 0.68573218 0.94355722
> rowSums(tmp2)
[1] -0.26628786 0.23887354 -0.38480677 1.53212024 -0.03229616 1.22813353
[7] -0.89675722 1.03180624 0.53404926 0.20876371 0.21220061 0.15164870
[13] 0.88136657 -3.04171467 0.62567551 0.05368464 0.33343681 -0.42230702
[19] 0.24576353 -0.06567287 -0.62033763 -2.44004439 -1.00572665 0.80059776
[25] -0.94571150 -0.15616587 1.68737459 -0.57524904 0.30501947 -1.57887518
[31] -0.29771317 0.10089503 1.81935387 0.14709082 1.72374330 2.35021299
[37] 0.03992896 -1.14471990 -0.31631411 1.20847826 -0.03037478 -1.27081081
[43] -1.15769322 0.07853368 2.18392639 1.60089313 -2.44126566 1.24214244
[49] -0.70859355 -1.20575210 1.14140371 0.46546977 1.78076982 1.15780828
[55] 0.58404272 -0.22796287 1.16346935 -0.34040761 -0.87341210 0.26733362
[61] 0.36336356 -0.69616436 1.57780114 0.33037090 0.39315219 1.81385811
[67] -0.31943427 -0.10028423 1.58583787 -0.33136112 -0.36503328 -0.95953839
[73] 0.10951494 -0.57594875 -1.17371663 -0.61554428 -0.01447888 0.78982250
[79] -0.20267827 0.93693126 -1.51771336 0.69977310 -0.49857848 1.27768974
[85] 1.81600810 -0.61691858 -1.65087643 0.62167974 -1.50935076 -0.28808604
[91] -0.46577395 0.32399397 0.39094403 -1.48417475 2.21003288 -2.73103105
[97] 1.38679365 -0.23344467 0.68573218 0.94355722
> 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.26628786 0.23887354 -0.38480677 1.53212024 -0.03229616 1.22813353
[7] -0.89675722 1.03180624 0.53404926 0.20876371 0.21220061 0.15164870
[13] 0.88136657 -3.04171467 0.62567551 0.05368464 0.33343681 -0.42230702
[19] 0.24576353 -0.06567287 -0.62033763 -2.44004439 -1.00572665 0.80059776
[25] -0.94571150 -0.15616587 1.68737459 -0.57524904 0.30501947 -1.57887518
[31] -0.29771317 0.10089503 1.81935387 0.14709082 1.72374330 2.35021299
[37] 0.03992896 -1.14471990 -0.31631411 1.20847826 -0.03037478 -1.27081081
[43] -1.15769322 0.07853368 2.18392639 1.60089313 -2.44126566 1.24214244
[49] -0.70859355 -1.20575210 1.14140371 0.46546977 1.78076982 1.15780828
[55] 0.58404272 -0.22796287 1.16346935 -0.34040761 -0.87341210 0.26733362
[61] 0.36336356 -0.69616436 1.57780114 0.33037090 0.39315219 1.81385811
[67] -0.31943427 -0.10028423 1.58583787 -0.33136112 -0.36503328 -0.95953839
[73] 0.10951494 -0.57594875 -1.17371663 -0.61554428 -0.01447888 0.78982250
[79] -0.20267827 0.93693126 -1.51771336 0.69977310 -0.49857848 1.27768974
[85] 1.81600810 -0.61691858 -1.65087643 0.62167974 -1.50935076 -0.28808604
[91] -0.46577395 0.32399397 0.39094403 -1.48417475 2.21003288 -2.73103105
[97] 1.38679365 -0.23344467 0.68573218 0.94355722
> rowMin(tmp2)
[1] -0.26628786 0.23887354 -0.38480677 1.53212024 -0.03229616 1.22813353
[7] -0.89675722 1.03180624 0.53404926 0.20876371 0.21220061 0.15164870
[13] 0.88136657 -3.04171467 0.62567551 0.05368464 0.33343681 -0.42230702
[19] 0.24576353 -0.06567287 -0.62033763 -2.44004439 -1.00572665 0.80059776
[25] -0.94571150 -0.15616587 1.68737459 -0.57524904 0.30501947 -1.57887518
[31] -0.29771317 0.10089503 1.81935387 0.14709082 1.72374330 2.35021299
[37] 0.03992896 -1.14471990 -0.31631411 1.20847826 -0.03037478 -1.27081081
[43] -1.15769322 0.07853368 2.18392639 1.60089313 -2.44126566 1.24214244
[49] -0.70859355 -1.20575210 1.14140371 0.46546977 1.78076982 1.15780828
[55] 0.58404272 -0.22796287 1.16346935 -0.34040761 -0.87341210 0.26733362
[61] 0.36336356 -0.69616436 1.57780114 0.33037090 0.39315219 1.81385811
[67] -0.31943427 -0.10028423 1.58583787 -0.33136112 -0.36503328 -0.95953839
[73] 0.10951494 -0.57594875 -1.17371663 -0.61554428 -0.01447888 0.78982250
[79] -0.20267827 0.93693126 -1.51771336 0.69977310 -0.49857848 1.27768974
[85] 1.81600810 -0.61691858 -1.65087643 0.62167974 -1.50935076 -0.28808604
[91] -0.46577395 0.32399397 0.39094403 -1.48417475 2.21003288 -2.73103105
[97] 1.38679365 -0.23344467 0.68573218 0.94355722
>
> colMeans(tmp2)
[1] 0.08585765
> colSums(tmp2)
[1] 8.585765
> colVars(tmp2)
[1] 1.218886
> colSd(tmp2)
[1] 1.104032
> colMax(tmp2)
[1] 2.350213
> colMin(tmp2)
[1] -3.041715
> colMedians(tmp2)
[1] 0.08971435
> colRanges(tmp2)
[,1]
[1,] -3.041715
[2,] 2.350213
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] 3.6181984 2.7101693 -3.5719371 0.1651310 1.5853944 0.3776441
[7] 3.1026736 5.6818828 2.4466109 4.8375744
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.3247014
[2,] -0.5997698
[3,] 0.2401702
[4,] 1.4038885
[5,] 2.0318203
>
> rowApply(tmp,sum)
[1] 5.2683203 3.3075447 -0.1881815 -1.6647774 3.7553451 -0.7679007
[7] 3.7991359 5.3494732 1.7935551 0.3008271
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 9 10 2 2 10 8 4 1 10 5
[2,] 6 9 1 3 3 3 9 6 8 9
[3,] 10 3 3 1 4 6 1 3 2 4
[4,] 1 7 6 7 2 1 6 4 9 7
[5,] 5 8 4 10 1 4 3 10 4 1
[6,] 8 1 7 4 6 9 5 5 1 2
[7,] 4 5 8 9 7 5 2 7 3 8
[8,] 7 2 9 5 5 10 7 9 6 3
[9,] 3 6 10 6 9 2 8 2 5 10
[10,] 2 4 5 8 8 7 10 8 7 6
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 6.1517740 2.0903767 -4.6224676 4.8945932 -0.5161475 1.7628142
[7] 2.3883704 3.4978379 -2.0418702 -1.0650205 0.4754197 -2.8674504
[13] 3.3040886 0.8888837 -0.1741192 0.6958290 0.2571858 -2.4877131
[19] -0.9409992 1.5503077
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.8097508
[2,] 0.8038198
[3,] 1.3041150
[4,] 2.1856301
[5,] 2.6679599
>
> rowApply(tmp,sum)
[1] -3.553001 8.950156 3.063583 7.049710 -2.268756
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 19 4 20 14 20
[2,] 1 14 19 19 10
[3,] 4 1 3 10 5
[4,] 20 8 18 18 12
[5,] 9 16 11 16 1
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1.3041150 -1.9648115 -0.9881874 1.7506619 -0.3530112 -0.31158606
[2,] -0.8097508 0.9603187 -1.4817871 0.4946165 1.2607186 1.89110464
[3,] 2.6679599 1.6179396 -1.1627689 1.0723585 0.1360508 0.78610225
[4,] 0.8038198 1.5840660 0.1732512 1.3445982 1.1407408 -0.68495311
[5,] 2.1856301 -0.1071361 -1.1629754 0.2323581 -2.7006465 0.08214646
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 1.0265818 -0.2723281 -0.8046747 0.2084480 0.1960155 0.1886739
[2,] 0.5042536 1.3681308 -1.1729954 0.6316145 -0.1626839 0.9868240
[3,] 0.5754195 0.3554805 0.5744722 -0.3300551 0.1119054 -1.2982742
[4,] -0.1069421 2.3710586 -0.9268469 -0.2519396 -0.5028154 -0.5991444
[5,] 0.3890575 -0.3245040 0.2881745 -1.3230884 0.8329981 -2.1455297
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.3619134 -1.25692438 0.2755135 0.4975088 -0.7415764 -0.4759065
[2,] 1.8038641 -0.02151951 0.4999398 -0.1048726 0.5841613 0.9341171
[3,] -1.2929864 0.77404664 -0.4374613 -0.2970039 -0.1319894 -1.0391416
[4,] 1.3384793 0.66541191 -0.3207453 0.9324524 0.6963008 -0.2238305
[5,] 1.0928182 0.72786905 -0.1913659 -0.3322557 -0.1497104 -1.6829516
[,19] [,20]
[1,] -1.3317139 -0.8617129
[2,] -0.9394439 1.7235458
[3,] 0.8652523 -0.4837236
[4,] -0.5818037 0.1985525
[5,] 1.0467101 0.9736458
>
>
> 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 : 653 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.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 -0.929734 -0.3855385 2.121231 -0.4900713 -0.6398514 -1.263104 -0.5904977
col8 col9 col10 col11 col12 col13 col14
row1 1.511713 -0.8485391 0.03426585 0.671521 0.09765489 0.162103 1.244444
col15 col16 col17 col18 col19 col20
row1 2.010524 1.522987 0.2548752 0.1912808 0.9684136 1.465415
> tmp[,"col10"]
col10
row1 0.03426585
row2 -0.75122160
row3 -0.13652720
row4 1.01865387
row5 1.46689399
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -0.929734 -0.3855385 2.121231 -0.4900713 -0.6398514 -1.26310398 -0.5904977
row5 0.535173 -0.5942554 2.399531 0.5977476 1.0989026 -0.03404349 -0.8672408
col8 col9 col10 col11 col12 col13 col14
row1 1.511713 -0.8485391 0.03426585 0.671521 0.09765489 0.1621030 1.2444438
row5 0.773957 -1.8374745 1.46689399 0.060792 -1.68473880 -0.6964874 -0.4231935
col15 col16 col17 col18 col19 col20
row1 2.0105235 1.5229870 0.2548752 0.1912808 0.96841363 1.465415
row5 0.3965058 0.1472632 0.7709499 -0.3217347 -0.03200409 1.329791
> tmp[,c("col6","col20")]
col6 col20
row1 -1.26310398 1.46541475
row2 -0.11784049 0.07264867
row3 -0.03280509 -0.96771476
row4 1.38491769 -0.68695695
row5 -0.03404349 1.32979123
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -1.26310398 1.465415
row5 -0.03404349 1.329791
>
>
>
>
> 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.09373 50.67944 48.42733 51.04331 49.54305 105.9752 50.15875 51.00034
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.85537 50.30278 49.54452 48.64442 49.59869 48.72919 50.47979 49.02054
col17 col18 col19 col20
row1 50.94072 48.27166 49.59512 105.0961
> tmp[,"col10"]
col10
row1 50.30278
row2 27.67659
row3 28.75303
row4 29.27406
row5 48.93421
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.09373 50.67944 48.42733 51.04331 49.54305 105.9752 50.15875 51.00034
row5 51.39073 49.27967 48.98352 49.54356 49.38640 103.6501 51.23993 50.27458
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.85537 50.30278 49.54452 48.64442 49.59869 48.72919 50.47979 49.02054
row5 50.54713 48.93421 48.56443 51.39687 51.01533 50.17925 48.69033 48.56944
col17 col18 col19 col20
row1 50.94072 48.27166 49.59512 105.0961
row5 48.85937 50.19683 48.48270 104.5549
> tmp[,c("col6","col20")]
col6 col20
row1 105.97525 105.09606
row2 73.81186 75.98256
row3 74.78816 77.01817
row4 74.48191 76.80708
row5 103.65009 104.55486
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.9752 105.0961
row5 103.6501 104.5549
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.9752 105.0961
row5 103.6501 104.5549
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.5160915
[2,] -1.4066006
[3,] -0.8967828
[4,] -2.3323783
[5,] -0.2489999
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.3678645 0.8333666
[2,] 0.6634288 -0.8996715
[3,] -0.8618738 -1.0968779
[4,] 0.1042531 -1.0180210
[5,] -0.5662357 0.7385391
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.2791889 1.5142742
[2,] -1.1748209 1.0551312
[3,] 0.5666280 -0.2605365
[4,] -0.7934439 0.6466971
[5,] -2.7300346 -0.7020692
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.2791889
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.2791889
[2,] -1.1748209
>
>
>
> 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.1716357 0.9751375 0.5444233 -0.8184133 -1.3355717 -1.7120186
row1 -0.7236182 1.1537457 -0.6905849 0.8053333 0.9042949 0.1652376
[,7] [,8] [,9] [,10] [,11] [,12]
row3 -0.1433773 1.4823455 -0.9302597 0.589048567 0.6140506 0.01181223
row1 -1.7558099 0.9464279 2.1033330 0.003106561 0.4690193 -0.24136165
[,13] [,14] [,15] [,16] [,17] [,18] [,19]
row3 2.0106115 0.6290959 -0.6040759 -0.9248673 0.9736104 -0.3180664 -0.6142772
row1 -0.1777855 0.7362716 -0.7253819 0.9491603 0.3193131 1.4241222 0.5656082
[,20]
row3 -0.1451320
row1 -0.5443975
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -1.02968 -1.081794 -0.8221271 0.5952671 0.2951088 0.6322789 0.5595634
[,8] [,9] [,10]
row2 -0.4746052 -0.9726939 -0.5892191
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.7964469 -0.5462794 0.1449588 -1.791256 -0.6084928 0.3269943 -2.224608
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.4019657 0.3818544 -1.350324 0.3121997 -0.9585342 -0.3537185 -0.6916655
[,15] [,16] [,17] [,18] [,19] [,20]
row5 1.730877 0.09263693 -0.09372555 0.05427098 0.361124 -0.7897594
>
>
> 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: 0x5dd22fc35670>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a15fd7afa73ca"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a15fd34f42f61"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a15fd6e3abf21"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a15fd4af0bf7f"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a15fd3b1ae9cd"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a15fd118dc63c"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a15fd77eed729"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a15fd25dd5d1b"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a15fd5a38e207"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a15fdeca53c1"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a15fd79bcc159"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a15fd196f18ad"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a15fda240647"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a15fd6db6e95f"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1a15fdc9c93d1"
>
>
> ### 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: 0x5dd230e3b9f0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5dd230e3b9f0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5dd230e3b9f0>
> rowMedians(tmp)
[1] -0.629762352 -0.343140290 -0.266021113 0.581219830 -0.045729672
[6] 0.015171742 0.332601247 -0.321533372 0.175971956 -0.154630562
[11] -0.095949014 -0.190433017 0.113815866 -0.076746060 0.321926897
[16] -0.542321280 0.055400832 0.060693905 0.178640226 -0.361225546
[21] 0.134055430 0.176158715 -0.600651725 0.313095969 0.169485945
[26] 0.111366842 -0.332021070 -0.103109277 -0.157324395 -0.692382697
[31] -0.367943377 0.017913010 0.233990836 0.018403742 -0.175244975
[36] -0.284535797 -0.552384476 -0.001926702 -0.170739334 -0.336581766
[41] 0.152868085 -0.214395780 -0.499614742 0.060146166 -0.157109429
[46] -0.068602309 0.280503604 0.351725760 -0.252048059 0.130197732
[51] -0.697089166 0.042006437 -0.072609120 0.337875982 -0.471463140
[56] 0.208497047 0.300885678 0.018761987 -0.209694232 0.076905867
[61] 0.113317541 0.425402646 0.060165579 1.037308102 -0.336006816
[66] 0.405064135 -0.095300786 -0.006745644 0.161336589 0.236859216
[71] -0.005674289 0.130367223 -0.175411332 0.178678019 -0.311652828
[76] -0.008155185 -0.387937521 -0.357694559 -0.288490117 -0.536869631
[81] 0.127741413 0.150153999 0.243912020 0.204947684 -0.034188574
[86] -0.220457083 0.248162747 -0.502020839 0.018709877 0.240199201
[91] 0.169489669 -0.055782256 -0.373512384 0.344183354 -0.428889401
[96] 0.181729329 0.516969888 -0.483412499 -0.046333372 0.367683861
[101] 0.077621191 -0.503313108 0.030922261 0.126935978 0.320516276
[106] 0.136456772 0.184374166 -0.297511528 0.179978624 -0.008991821
[111] 0.516216229 0.203191980 0.566987646 -0.008436981 -0.264958191
[116] -0.120849741 0.270300207 -0.307555014 0.281584824 0.260477730
[121] -0.375286072 -0.414613983 -0.245376933 -0.279492243 -1.044644384
[126] 0.078572579 0.048411073 -0.259042052 0.548897623 0.104326025
[131] 0.125077287 -0.130736467 0.046166591 -0.404505618 0.051027042
[136] 0.038213968 -0.001672142 -0.074595464 0.266353496 0.349599308
[141] 0.423724339 0.025467326 -0.212739292 0.168305503 0.297153816
[146] 0.174351330 -0.053551808 -0.484855934 0.110804653 0.295997000
[151] -0.738154089 -0.686416290 -0.536356402 0.399194529 -0.311850979
[156] 0.204989467 -0.253560863 -0.170020228 -0.213660969 0.004987913
[161] 0.613242321 0.410378662 0.001786948 0.201768262 0.191494356
[166] -0.039520429 0.336700178 -0.130742985 -0.135570793 -0.609400913
[171] 0.938522219 -0.035467839 0.776125878 -0.414008568 0.162292754
[176] 0.976951103 0.025945383 0.074578661 0.349757395 -0.183320316
[181] -0.282769995 0.135872609 0.335552142 0.372393823 -0.195862792
[186] -0.178896288 -0.702118252 -0.300914219 0.072024095 -0.040478263
[191] -0.503923142 0.402034617 0.028015216 -0.381711903 0.124209810
[196] -0.200235822 0.268930828 0.097654453 0.640153974 0.083296929
[201] -0.321477467 -0.106344445 0.190890408 0.126658240 -0.438740239
[206] -0.558845954 -0.367815824 -0.062221946 -0.163601431 -0.204231265
[211] -0.063039534 0.551352863 0.642946497 0.347906222 0.428780631
[216] -0.057682687 -0.044620717 0.513467323 -0.178935155 0.085593234
[221] 0.643862277 0.003195522 -0.075520303 0.270400185 0.160734129
[226] -0.401781394 0.002476326 -0.037189893 -0.060331681 -0.146612082
>
> proc.time()
user system elapsed
1.346 1.453 2.786
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: 0x6205dad71ff0>
> .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: 0x6205dad71ff0>
> .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: 0x6205dad71ff0>
> .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: 0x6205dad71ff0>
> 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: 0x6205daa1d710>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6205daa1d710>
> .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: 0x6205daa1d710>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6205daa1d710>
> .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: 0x6205daa1d710>
> 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: 0x6205dad813f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6205dad813f0>
> .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: 0x6205dad813f0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6205dad813f0>
> .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: 0x6205dad813f0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x6205dad813f0>
> .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: 0x6205dad813f0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x6205dad813f0>
> .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: 0x6205dad813f0>
> 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: 0x6205da4b88c0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6205da4b88c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6205da4b88c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6205da4b88c0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1a168c1ef21323" "BufferedMatrixFile1a168c40f46f3a"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1a168c1ef21323" "BufferedMatrixFile1a168c40f46f3a"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6205da1e4e30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6205da1e4e30>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6205da1e4e30>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6205da1e4e30>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6205da1e4e30>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6205da1e4e30>
> .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: 0x6205db340790>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6205db340790>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6205db340790>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6205db340790>
> 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: 0x6205da72b860>
> .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: 0x6205da72b860>
> rm(P)
>
> proc.time()
user system elapsed
0.244 0.055 0.285
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.277 0.056 0.312