| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-04-04 11:34 -0400 (Sat, 04 Apr 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.6.0 alpha (2026-03-30 r89742) | 4900 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.6.0 alpha (2026-03-28 r89739) | 4634 |
| 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 258/2381 | 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-04-03 21:40:08 -0400 (Fri, 03 Apr 2026) |
| EndedAt: 2026-04-03 21:40:33 -0400 (Fri, 03 Apr 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 version 4.6.0 alpha (2026-03-30 r89742)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
* running under: Ubuntu 24.04.4 LTS
* using session charset: UTF-8
* current time: 2026-04-04 01:40:08 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/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o
installing to /home/biocbuild/bbs-3.23-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R version 4.6.0 alpha (2026-03-30 r89742)
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.243 0.048 0.280
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.6.0 alpha (2026-03-30 r89742)
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 480181 25.7 1053160 56.3 637571 34.1
Vcells 887210 6.8 8388608 64.0 2083864 15.9
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri Apr 3 21:40:23 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri Apr 3 21:40:23 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: 0x61670021a380>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri Apr 3 21:40:23 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri Apr 3 21:40:23 2026"
>
> ColMode(tmp2)
<pointer: 0x61670021a380>
>
>
>
> ### 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.02824387 0.30649840 0.8051037 -0.5641564
[2,] -0.09893069 0.52140778 1.7724170 -1.6265849
[3,] -0.05351545 -1.08399071 -0.1761528 2.2014042
[4,] 0.11811319 -0.01770014 -0.1551688 -0.6342705
> 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.02824387 0.30649840 0.8051037 0.5641564
[2,] 0.09893069 0.52140778 1.7724170 1.6265849
[3,] 0.05351545 1.08399071 0.1761528 2.2014042
[4,] 0.11811319 0.01770014 0.1551688 0.6342705
> 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.0014121 0.5536230 0.8972757 0.7511035
[2,] 0.3145325 0.7220857 1.3313215 1.2753764
[3,] 0.2313341 1.0411487 0.4197056 1.4837130
[4,] 0.3436760 0.1330419 0.3939147 0.7964110
>
> 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,] 225.04236 30.84273 34.77786 33.07519
[2,] 28.24426 32.74226 40.08563 39.38035
[3,] 27.36686 36.49548 29.37321 42.03853
[4,] 28.55487 26.34812 29.09432 33.59838
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x616701936580>
> exp(tmp5)
<pointer: 0x616701936580>
> log(tmp5,2)
<pointer: 0x616701936580>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.3962
> Min(tmp5)
[1] 52.18376
> mean(tmp5)
[1] 72.21768
> Sum(tmp5)
[1] 14443.54
> Var(tmp5)
[1] 859.6549
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.74705 69.55962 68.39384 66.38653 73.64549 68.02044 69.26922 72.32695
[9] 72.23767 70.58996
> rowSums(tmp5)
[1] 1834.941 1391.192 1367.877 1327.731 1472.910 1360.409 1385.384 1446.539
[9] 1444.753 1411.799
> rowVars(tmp5)
[1] 7911.85115 44.80566 76.32706 65.59862 49.06130 45.88458
[7] 58.23548 81.67999 72.96324 104.61342
> rowSd(tmp5)
[1] 88.948587 6.693703 8.736536 8.099297 7.004378 6.773816 7.631217
[8] 9.037698 8.541852 10.228070
> rowMax(tmp5)
[1] 468.39620 83.43299 87.49770 80.65146 83.94367 79.95999 82.15455
[8] 87.85397 89.62220 91.54545
> rowMin(tmp5)
[1] 57.90980 58.78672 55.57106 53.33514 57.05185 54.33921 56.95612 52.18376
[9] 57.58160 57.52624
>
> colMeans(tmp5)
[1] 107.68343 68.51179 71.18387 72.70438 67.32453 68.38544 72.07126
[8] 73.93789 70.72239 69.70927 68.71132 69.83330 74.12273 74.15698
[15] 67.34530 66.48576 68.76965 72.21012 70.17118 70.31297
> colSums(tmp5)
[1] 1076.8343 685.1179 711.8387 727.0438 673.2453 683.8544 720.7126
[8] 739.3789 707.2239 697.0927 687.1132 698.3330 741.2273 741.5698
[15] 673.4530 664.8576 687.6965 722.1012 701.7118 703.1297
> colVars(tmp5)
[1] 16122.22805 39.77677 69.28614 68.33221 38.48761 114.26708
[7] 53.79934 78.37062 124.54273 44.37154 75.49256 66.78806
[13] 112.30598 41.29583 54.90435 49.56181 65.44001 89.65239
[19] 68.20664 47.85253
> colSd(tmp5)
[1] 126.973336 6.306883 8.323830 8.266330 6.203838 10.689578
[7] 7.334804 8.852718 11.159871 6.661197 8.688645 8.172396
[13] 10.597452 6.426183 7.409747 7.040015 8.089500 9.468495
[19] 8.258731 6.917552
> colMax(tmp5)
[1] 468.39620 77.94182 83.53120 87.49770 75.24025 82.02738 85.24248
[8] 89.62220 85.58396 79.74164 83.66830 81.74036 91.54545 80.91093
[15] 77.03355 83.94367 81.40357 87.99783 83.46820 82.25092
> colMin(tmp5)
[1] 56.96053 54.84016 60.55601 57.05185 60.11783 52.18376 62.89293 59.16935
[9] 55.57106 60.08929 57.90980 57.39181 60.22494 64.65016 57.52624 59.16566
[17] 54.33921 58.60696 58.69135 58.02681
>
>
> ### 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] 91.74705 69.55962 NA 66.38653 73.64549 68.02044 69.26922 72.32695
[9] 72.23767 70.58996
> rowSums(tmp5)
[1] 1834.941 1391.192 NA 1327.731 1472.910 1360.409 1385.384 1446.539
[9] 1444.753 1411.799
> rowVars(tmp5)
[1] 7911.85115 44.80566 70.95203 65.59862 49.06130 45.88458
[7] 58.23548 81.67999 72.96324 104.61342
> rowSd(tmp5)
[1] 88.948587 6.693703 8.423303 8.099297 7.004378 6.773816 7.631217
[8] 9.037698 8.541852 10.228070
> rowMax(tmp5)
[1] 468.39620 83.43299 NA 80.65146 83.94367 79.95999 82.15455
[8] 87.85397 89.62220 91.54545
> rowMin(tmp5)
[1] 57.90980 58.78672 NA 53.33514 57.05185 54.33921 56.95612 52.18376
[9] 57.58160 57.52624
>
> colMeans(tmp5)
[1] 107.68343 68.51179 71.18387 72.70438 67.32453 68.38544 72.07126
[8] 73.93789 NA 69.70927 68.71132 69.83330 74.12273 74.15698
[15] 67.34530 66.48576 68.76965 72.21012 70.17118 70.31297
> colSums(tmp5)
[1] 1076.8343 685.1179 711.8387 727.0438 673.2453 683.8544 720.7126
[8] 739.3789 NA 697.0927 687.1132 698.3330 741.2273 741.5698
[15] 673.4530 664.8576 687.6965 722.1012 701.7118 703.1297
> colVars(tmp5)
[1] 16122.22805 39.77677 69.28614 68.33221 38.48761 114.26708
[7] 53.79934 78.37062 NA 44.37154 75.49256 66.78806
[13] 112.30598 41.29583 54.90435 49.56181 65.44001 89.65239
[19] 68.20664 47.85253
> colSd(tmp5)
[1] 126.973336 6.306883 8.323830 8.266330 6.203838 10.689578
[7] 7.334804 8.852718 NA 6.661197 8.688645 8.172396
[13] 10.597452 6.426183 7.409747 7.040015 8.089500 9.468495
[19] 8.258731 6.917552
> colMax(tmp5)
[1] 468.39620 77.94182 83.53120 87.49770 75.24025 82.02738 85.24248
[8] 89.62220 NA 79.74164 83.66830 81.74036 91.54545 80.91093
[15] 77.03355 83.94367 81.40357 87.99783 83.46820 82.25092
> colMin(tmp5)
[1] 56.96053 54.84016 60.55601 57.05185 60.11783 52.18376 62.89293 59.16935
[9] NA 60.08929 57.90980 57.39181 60.22494 64.65016 57.52624 59.16566
[17] 54.33921 58.60696 58.69135 58.02681
>
> Max(tmp5,na.rm=TRUE)
[1] 468.3962
> Min(tmp5,na.rm=TRUE)
[1] 52.18376
> mean(tmp5,na.rm=TRUE)
[1] 72.30133
> Sum(tmp5,na.rm=TRUE)
[1] 14387.96
> Var(tmp5,na.rm=TRUE)
[1] 862.59
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.74705 69.55962 69.06872 66.38653 73.64549 68.02044 69.26922 72.32695
[9] 72.23767 70.58996
> rowSums(tmp5,na.rm=TRUE)
[1] 1834.941 1391.192 1312.306 1327.731 1472.910 1360.409 1385.384 1446.539
[9] 1444.753 1411.799
> rowVars(tmp5,na.rm=TRUE)
[1] 7911.85115 44.80566 70.95203 65.59862 49.06130 45.88458
[7] 58.23548 81.67999 72.96324 104.61342
> rowSd(tmp5,na.rm=TRUE)
[1] 88.948587 6.693703 8.423303 8.099297 7.004378 6.773816 7.631217
[8] 9.037698 8.541852 10.228070
> rowMax(tmp5,na.rm=TRUE)
[1] 468.39620 83.43299 87.49770 80.65146 83.94367 79.95999 82.15455
[8] 87.85397 89.62220 91.54545
> rowMin(tmp5,na.rm=TRUE)
[1] 57.90980 58.78672 56.96053 53.33514 57.05185 54.33921 56.95612 52.18376
[9] 57.58160 57.52624
>
> colMeans(tmp5,na.rm=TRUE)
[1] 107.68343 68.51179 71.18387 72.70438 67.32453 68.38544 72.07126
[8] 73.93789 72.40587 69.70927 68.71132 69.83330 74.12273 74.15698
[15] 67.34530 66.48576 68.76965 72.21012 70.17118 70.31297
> colSums(tmp5,na.rm=TRUE)
[1] 1076.8343 685.1179 711.8387 727.0438 673.2453 683.8544 720.7126
[8] 739.3789 651.6529 697.0927 687.1132 698.3330 741.2273 741.5698
[15] 673.4530 664.8576 687.6965 722.1012 701.7118 703.1297
> colVars(tmp5,na.rm=TRUE)
[1] 16122.22805 39.77677 69.28614 68.33221 38.48761 114.26708
[7] 53.79934 78.37062 108.22684 44.37154 75.49256 66.78806
[13] 112.30598 41.29583 54.90435 49.56181 65.44001 89.65239
[19] 68.20664 47.85253
> colSd(tmp5,na.rm=TRUE)
[1] 126.973336 6.306883 8.323830 8.266330 6.203838 10.689578
[7] 7.334804 8.852718 10.403213 6.661197 8.688645 8.172396
[13] 10.597452 6.426183 7.409747 7.040015 8.089500 9.468495
[19] 8.258731 6.917552
> colMax(tmp5,na.rm=TRUE)
[1] 468.39620 77.94182 83.53120 87.49770 75.24025 82.02738 85.24248
[8] 89.62220 85.58396 79.74164 83.66830 81.74036 91.54545 80.91093
[15] 77.03355 83.94367 81.40357 87.99783 83.46820 82.25092
> colMin(tmp5,na.rm=TRUE)
[1] 56.96053 54.84016 60.55601 57.05185 60.11783 52.18376 62.89293 59.16935
[9] 56.80839 60.08929 57.90980 57.39181 60.22494 64.65016 57.52624 59.16566
[17] 54.33921 58.60696 58.69135 58.02681
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.74705 69.55962 NaN 66.38653 73.64549 68.02044 69.26922 72.32695
[9] 72.23767 70.58996
> rowSums(tmp5,na.rm=TRUE)
[1] 1834.941 1391.192 0.000 1327.731 1472.910 1360.409 1385.384 1446.539
[9] 1444.753 1411.799
> rowVars(tmp5,na.rm=TRUE)
[1] 7911.85115 44.80566 NA 65.59862 49.06130 45.88458
[7] 58.23548 81.67999 72.96324 104.61342
> rowSd(tmp5,na.rm=TRUE)
[1] 88.948587 6.693703 NA 8.099297 7.004378 6.773816 7.631217
[8] 9.037698 8.541852 10.228070
> rowMax(tmp5,na.rm=TRUE)
[1] 468.39620 83.43299 NA 80.65146 83.94367 79.95999 82.15455
[8] 87.85397 89.62220 91.54545
> rowMin(tmp5,na.rm=TRUE)
[1] 57.90980 58.78672 NA 53.33514 57.05185 54.33921 56.95612 52.18376
[9] 57.58160 57.52624
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 113.31930 67.68415 72.30024 71.06068 67.93619 68.97683 71.95044
[8] 75.57884 NaN 70.47649 67.58228 69.03191 75.43312 75.21329
[15] 67.53403 66.67693 67.99425 72.59399 69.04949 70.05262
> colSums(tmp5,na.rm=TRUE)
[1] 1019.8737 609.1574 650.7022 639.5461 611.4257 620.7914 647.5540
[8] 680.2096 0.0000 634.2884 608.2405 621.2872 678.8981 676.9196
[15] 607.8063 600.0923 611.9482 653.3459 621.4455 630.4736
> colVars(tmp5,na.rm=TRUE)
[1] 17780.17146 37.04275 63.92609 46.47899 39.08953 124.61600
[7] 60.36006 57.87391 NA 43.29594 70.58836 67.91160
[13] 107.02648 33.90508 61.36665 55.34591 66.85598 99.20115
[19] 62.57804 53.07156
> colSd(tmp5,na.rm=TRUE)
[1] 133.342309 6.086275 7.995379 6.817550 6.252162 11.163153
[7] 7.769174 7.607490 NA 6.579965 8.401688 8.240850
[13] 10.345360 5.822807 7.833687 7.439483 8.176550 9.959978
[19] 7.910628 7.285023
> colMax(tmp5,na.rm=TRUE)
[1] 468.39620 77.94182 83.53120 81.96504 75.24025 82.02738 85.24248
[8] 89.62220 -Inf 79.74164 83.66830 81.74036 91.54545 80.91093
[15] 77.03355 83.94367 81.40357 87.99783 83.46820 82.25092
> colMin(tmp5,na.rm=TRUE)
[1] 58.78672 54.84016 60.55601 57.05185 60.11783 52.18376 62.89293 64.65100
[9] Inf 60.08929 57.90980 57.39181 60.22494 66.02577 57.52624 59.16566
[17] 54.33921 58.60696 58.69135 58.02681
>
>
>
>
> 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] 282.8743 258.1778 236.8213 259.9413 177.3717 365.9452 255.1727 227.6030
[9] 115.5056 199.4782
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 282.8743 258.1778 236.8213 259.9413 177.3717 365.9452 255.1727 227.6030
[9] 115.5056 199.4782
>
>
>
> 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 5.684342e-14 -8.526513e-14 -1.705303e-13 0.000000e+00
[6] -4.263256e-14 2.842171e-14 -2.842171e-14 2.842171e-14 0.000000e+00
[11] 7.105427e-14 2.842171e-14 -5.684342e-14 4.263256e-14 0.000000e+00
[16] -1.705303e-13 -1.989520e-13 -1.136868e-13 -5.684342e-14 8.526513e-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)
+ }
5 7
8 2
3 18
5 14
8 17
2 7
10 15
2 6
2 7
5 11
10 17
2 12
6 8
10 1
9 4
3 19
4 14
5 8
6 8
7 11
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] 1.993317
> Min(tmp)
[1] -2.400349
> mean(tmp)
[1] 0.128197
> Sum(tmp)
[1] 12.8197
> Var(tmp)
[1] 0.796093
>
> rowMeans(tmp)
[1] 0.128197
> rowSums(tmp)
[1] 12.8197
> rowVars(tmp)
[1] 0.796093
> rowSd(tmp)
[1] 0.8922404
> rowMax(tmp)
[1] 1.993317
> rowMin(tmp)
[1] -2.400349
>
> colMeans(tmp)
[1] 0.848312834 -1.265155611 -1.890845154 -0.022916924 -0.533031330
[6] 0.625779219 -0.843168325 1.482834640 -0.338704226 -1.064531101
[11] 0.255253894 0.747650385 0.245046266 0.799884230 0.712518771
[16] 0.185843579 -0.121334876 0.977752018 -0.616837125 -1.224664128
[21] 1.116928429 0.445221691 -0.006741959 -1.704673332 0.846669684
[26] 0.458908199 -0.638774631 1.272482183 -0.183111218 0.386310956
[31] 0.564638429 -0.226486488 0.546977939 0.480992467 -0.895418322
[36] -0.109615635 0.177160868 -0.847486300 -1.068141862 0.487016784
[41] 0.533896641 1.993316743 0.865989709 -0.750037492 -0.307941751
[46] 1.343181918 -1.625181271 -0.088425175 1.010747162 0.478945112
[51] 0.736964600 -0.481566844 0.732251954 -0.075121949 -0.377644770
[56] 1.389860414 0.854843385 1.120675510 0.126034793 -0.179696547
[61] 1.779652376 -0.175095781 0.616232001 1.102339761 -0.200470042
[66] -0.878359237 0.629112370 1.055062195 -0.565491974 0.683374025
[71] -0.957092922 -0.543427968 0.013619924 -0.355528622 0.060484359
[76] -1.134283210 1.075314121 0.576749200 1.547613111 -0.292951977
[81] 1.716053555 -1.522635980 -0.011576237 -0.835663856 -1.248233850
[86] 1.262884502 0.528074938 1.239597672 0.993366437 0.143541313
[91] 0.191431293 -0.465235967 0.149552252 0.067033140 1.605846774
[96] -0.241600074 1.160471335 -0.503932496 -0.409415561 -2.400348820
> colSums(tmp)
[1] 0.848312834 -1.265155611 -1.890845154 -0.022916924 -0.533031330
[6] 0.625779219 -0.843168325 1.482834640 -0.338704226 -1.064531101
[11] 0.255253894 0.747650385 0.245046266 0.799884230 0.712518771
[16] 0.185843579 -0.121334876 0.977752018 -0.616837125 -1.224664128
[21] 1.116928429 0.445221691 -0.006741959 -1.704673332 0.846669684
[26] 0.458908199 -0.638774631 1.272482183 -0.183111218 0.386310956
[31] 0.564638429 -0.226486488 0.546977939 0.480992467 -0.895418322
[36] -0.109615635 0.177160868 -0.847486300 -1.068141862 0.487016784
[41] 0.533896641 1.993316743 0.865989709 -0.750037492 -0.307941751
[46] 1.343181918 -1.625181271 -0.088425175 1.010747162 0.478945112
[51] 0.736964600 -0.481566844 0.732251954 -0.075121949 -0.377644770
[56] 1.389860414 0.854843385 1.120675510 0.126034793 -0.179696547
[61] 1.779652376 -0.175095781 0.616232001 1.102339761 -0.200470042
[66] -0.878359237 0.629112370 1.055062195 -0.565491974 0.683374025
[71] -0.957092922 -0.543427968 0.013619924 -0.355528622 0.060484359
[76] -1.134283210 1.075314121 0.576749200 1.547613111 -0.292951977
[81] 1.716053555 -1.522635980 -0.011576237 -0.835663856 -1.248233850
[86] 1.262884502 0.528074938 1.239597672 0.993366437 0.143541313
[91] 0.191431293 -0.465235967 0.149552252 0.067033140 1.605846774
[96] -0.241600074 1.160471335 -0.503932496 -0.409415561 -2.400348820
> 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.848312834 -1.265155611 -1.890845154 -0.022916924 -0.533031330
[6] 0.625779219 -0.843168325 1.482834640 -0.338704226 -1.064531101
[11] 0.255253894 0.747650385 0.245046266 0.799884230 0.712518771
[16] 0.185843579 -0.121334876 0.977752018 -0.616837125 -1.224664128
[21] 1.116928429 0.445221691 -0.006741959 -1.704673332 0.846669684
[26] 0.458908199 -0.638774631 1.272482183 -0.183111218 0.386310956
[31] 0.564638429 -0.226486488 0.546977939 0.480992467 -0.895418322
[36] -0.109615635 0.177160868 -0.847486300 -1.068141862 0.487016784
[41] 0.533896641 1.993316743 0.865989709 -0.750037492 -0.307941751
[46] 1.343181918 -1.625181271 -0.088425175 1.010747162 0.478945112
[51] 0.736964600 -0.481566844 0.732251954 -0.075121949 -0.377644770
[56] 1.389860414 0.854843385 1.120675510 0.126034793 -0.179696547
[61] 1.779652376 -0.175095781 0.616232001 1.102339761 -0.200470042
[66] -0.878359237 0.629112370 1.055062195 -0.565491974 0.683374025
[71] -0.957092922 -0.543427968 0.013619924 -0.355528622 0.060484359
[76] -1.134283210 1.075314121 0.576749200 1.547613111 -0.292951977
[81] 1.716053555 -1.522635980 -0.011576237 -0.835663856 -1.248233850
[86] 1.262884502 0.528074938 1.239597672 0.993366437 0.143541313
[91] 0.191431293 -0.465235967 0.149552252 0.067033140 1.605846774
[96] -0.241600074 1.160471335 -0.503932496 -0.409415561 -2.400348820
> colMin(tmp)
[1] 0.848312834 -1.265155611 -1.890845154 -0.022916924 -0.533031330
[6] 0.625779219 -0.843168325 1.482834640 -0.338704226 -1.064531101
[11] 0.255253894 0.747650385 0.245046266 0.799884230 0.712518771
[16] 0.185843579 -0.121334876 0.977752018 -0.616837125 -1.224664128
[21] 1.116928429 0.445221691 -0.006741959 -1.704673332 0.846669684
[26] 0.458908199 -0.638774631 1.272482183 -0.183111218 0.386310956
[31] 0.564638429 -0.226486488 0.546977939 0.480992467 -0.895418322
[36] -0.109615635 0.177160868 -0.847486300 -1.068141862 0.487016784
[41] 0.533896641 1.993316743 0.865989709 -0.750037492 -0.307941751
[46] 1.343181918 -1.625181271 -0.088425175 1.010747162 0.478945112
[51] 0.736964600 -0.481566844 0.732251954 -0.075121949 -0.377644770
[56] 1.389860414 0.854843385 1.120675510 0.126034793 -0.179696547
[61] 1.779652376 -0.175095781 0.616232001 1.102339761 -0.200470042
[66] -0.878359237 0.629112370 1.055062195 -0.565491974 0.683374025
[71] -0.957092922 -0.543427968 0.013619924 -0.355528622 0.060484359
[76] -1.134283210 1.075314121 0.576749200 1.547613111 -0.292951977
[81] 1.716053555 -1.522635980 -0.011576237 -0.835663856 -1.248233850
[86] 1.262884502 0.528074938 1.239597672 0.993366437 0.143541313
[91] 0.191431293 -0.465235967 0.149552252 0.067033140 1.605846774
[96] -0.241600074 1.160471335 -0.503932496 -0.409415561 -2.400348820
> colMedians(tmp)
[1] 0.848312834 -1.265155611 -1.890845154 -0.022916924 -0.533031330
[6] 0.625779219 -0.843168325 1.482834640 -0.338704226 -1.064531101
[11] 0.255253894 0.747650385 0.245046266 0.799884230 0.712518771
[16] 0.185843579 -0.121334876 0.977752018 -0.616837125 -1.224664128
[21] 1.116928429 0.445221691 -0.006741959 -1.704673332 0.846669684
[26] 0.458908199 -0.638774631 1.272482183 -0.183111218 0.386310956
[31] 0.564638429 -0.226486488 0.546977939 0.480992467 -0.895418322
[36] -0.109615635 0.177160868 -0.847486300 -1.068141862 0.487016784
[41] 0.533896641 1.993316743 0.865989709 -0.750037492 -0.307941751
[46] 1.343181918 -1.625181271 -0.088425175 1.010747162 0.478945112
[51] 0.736964600 -0.481566844 0.732251954 -0.075121949 -0.377644770
[56] 1.389860414 0.854843385 1.120675510 0.126034793 -0.179696547
[61] 1.779652376 -0.175095781 0.616232001 1.102339761 -0.200470042
[66] -0.878359237 0.629112370 1.055062195 -0.565491974 0.683374025
[71] -0.957092922 -0.543427968 0.013619924 -0.355528622 0.060484359
[76] -1.134283210 1.075314121 0.576749200 1.547613111 -0.292951977
[81] 1.716053555 -1.522635980 -0.011576237 -0.835663856 -1.248233850
[86] 1.262884502 0.528074938 1.239597672 0.993366437 0.143541313
[91] 0.191431293 -0.465235967 0.149552252 0.067033140 1.605846774
[96] -0.241600074 1.160471335 -0.503932496 -0.409415561 -2.400348820
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.8483128 -1.265156 -1.890845 -0.02291692 -0.5330313 0.6257792 -0.8431683
[2,] 0.8483128 -1.265156 -1.890845 -0.02291692 -0.5330313 0.6257792 -0.8431683
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 1.482835 -0.3387042 -1.064531 0.2552539 0.7476504 0.2450463 0.7998842
[2,] 1.482835 -0.3387042 -1.064531 0.2552539 0.7476504 0.2450463 0.7998842
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.7125188 0.1858436 -0.1213349 0.977752 -0.6168371 -1.224664 1.116928
[2,] 0.7125188 0.1858436 -0.1213349 0.977752 -0.6168371 -1.224664 1.116928
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.4452217 -0.006741959 -1.704673 0.8466697 0.4589082 -0.6387746 1.272482
[2,] 0.4452217 -0.006741959 -1.704673 0.8466697 0.4589082 -0.6387746 1.272482
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.1831112 0.386311 0.5646384 -0.2264865 0.5469779 0.4809925 -0.8954183
[2,] -0.1831112 0.386311 0.5646384 -0.2264865 0.5469779 0.4809925 -0.8954183
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.1096156 0.1771609 -0.8474863 -1.068142 0.4870168 0.5338966 1.993317
[2,] -0.1096156 0.1771609 -0.8474863 -1.068142 0.4870168 0.5338966 1.993317
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.8659897 -0.7500375 -0.3079418 1.343182 -1.625181 -0.08842517 1.010747
[2,] 0.8659897 -0.7500375 -0.3079418 1.343182 -1.625181 -0.08842517 1.010747
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.4789451 0.7369646 -0.4815668 0.732252 -0.07512195 -0.3776448 1.38986
[2,] 0.4789451 0.7369646 -0.4815668 0.732252 -0.07512195 -0.3776448 1.38986
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.8548434 1.120676 0.1260348 -0.1796965 1.779652 -0.1750958 0.616232
[2,] 0.8548434 1.120676 0.1260348 -0.1796965 1.779652 -0.1750958 0.616232
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 1.10234 -0.20047 -0.8783592 0.6291124 1.055062 -0.565492 0.683374
[2,] 1.10234 -0.20047 -0.8783592 0.6291124 1.055062 -0.565492 0.683374
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.9570929 -0.543428 0.01361992 -0.3555286 0.06048436 -1.134283 1.075314
[2,] -0.9570929 -0.543428 0.01361992 -0.3555286 0.06048436 -1.134283 1.075314
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.5767492 1.547613 -0.292952 1.716054 -1.522636 -0.01157624 -0.8356639
[2,] 0.5767492 1.547613 -0.292952 1.716054 -1.522636 -0.01157624 -0.8356639
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -1.248234 1.262885 0.5280749 1.239598 0.9933664 0.1435413 0.1914313
[2,] -1.248234 1.262885 0.5280749 1.239598 0.9933664 0.1435413 0.1914313
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.465236 0.1495523 0.06703314 1.605847 -0.2416001 1.160471 -0.5039325
[2,] -0.465236 0.1495523 0.06703314 1.605847 -0.2416001 1.160471 -0.5039325
[,99] [,100]
[1,] -0.4094156 -2.400349
[2,] -0.4094156 -2.400349
>
>
> Max(tmp2)
[1] 2.132667
> Min(tmp2)
[1] -2.464916
> mean(tmp2)
[1] -0.01576207
> Sum(tmp2)
[1] -1.576207
> Var(tmp2)
[1] 1.065891
>
> rowMeans(tmp2)
[1] -0.39361643 -0.22119319 0.49664934 -1.31707798 0.16768383 0.71508706
[7] -1.65834019 -0.93086871 -1.09434518 1.04165400 -2.46491630 0.60963723
[13] 1.07761631 0.25890456 -1.45696317 0.12967202 0.68882113 0.05851153
[19] -0.10000124 -0.83866088 -0.48381935 1.99488775 1.60565694 -0.22459772
[25] 0.17286723 -2.01612827 1.44579209 0.21485968 0.78995241 0.03841527
[31] -0.21640101 -1.10161938 0.70904839 0.47046758 1.41929116 -1.77612180
[37] -0.27091582 0.34132359 1.15063640 -1.06643621 -0.57804827 0.26943355
[43] 1.09267714 0.60277228 -1.96203827 0.47638237 0.39069087 1.40359207
[49] -0.85576822 -0.91479823 1.51247654 0.92996425 0.79617193 -0.97884895
[55] -0.05160747 1.11615193 -0.33394182 -0.78012508 1.36165644 -1.15018357
[61] -0.71884354 2.13266717 -0.71710088 1.30935555 0.54481846 0.49947220
[67] 0.18115268 -1.48930548 1.79180236 -1.70283216 -1.61662577 -1.70942663
[73] 0.46849685 0.58661426 -0.43366233 0.83838047 -0.54183524 -1.30635516
[79] 0.78883823 -0.40967451 0.12360600 -0.67316908 -0.06745759 0.57625076
[85] -1.19985489 -1.21199907 1.79680177 0.84028767 0.42478697 -0.91285219
[91] 0.17825778 0.81817433 -0.73305086 -1.06081783 1.16704062 0.76954207
[97] -1.76187163 -0.15925258 0.82743834 -0.12602590
> rowSums(tmp2)
[1] -0.39361643 -0.22119319 0.49664934 -1.31707798 0.16768383 0.71508706
[7] -1.65834019 -0.93086871 -1.09434518 1.04165400 -2.46491630 0.60963723
[13] 1.07761631 0.25890456 -1.45696317 0.12967202 0.68882113 0.05851153
[19] -0.10000124 -0.83866088 -0.48381935 1.99488775 1.60565694 -0.22459772
[25] 0.17286723 -2.01612827 1.44579209 0.21485968 0.78995241 0.03841527
[31] -0.21640101 -1.10161938 0.70904839 0.47046758 1.41929116 -1.77612180
[37] -0.27091582 0.34132359 1.15063640 -1.06643621 -0.57804827 0.26943355
[43] 1.09267714 0.60277228 -1.96203827 0.47638237 0.39069087 1.40359207
[49] -0.85576822 -0.91479823 1.51247654 0.92996425 0.79617193 -0.97884895
[55] -0.05160747 1.11615193 -0.33394182 -0.78012508 1.36165644 -1.15018357
[61] -0.71884354 2.13266717 -0.71710088 1.30935555 0.54481846 0.49947220
[67] 0.18115268 -1.48930548 1.79180236 -1.70283216 -1.61662577 -1.70942663
[73] 0.46849685 0.58661426 -0.43366233 0.83838047 -0.54183524 -1.30635516
[79] 0.78883823 -0.40967451 0.12360600 -0.67316908 -0.06745759 0.57625076
[85] -1.19985489 -1.21199907 1.79680177 0.84028767 0.42478697 -0.91285219
[91] 0.17825778 0.81817433 -0.73305086 -1.06081783 1.16704062 0.76954207
[97] -1.76187163 -0.15925258 0.82743834 -0.12602590
> 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.39361643 -0.22119319 0.49664934 -1.31707798 0.16768383 0.71508706
[7] -1.65834019 -0.93086871 -1.09434518 1.04165400 -2.46491630 0.60963723
[13] 1.07761631 0.25890456 -1.45696317 0.12967202 0.68882113 0.05851153
[19] -0.10000124 -0.83866088 -0.48381935 1.99488775 1.60565694 -0.22459772
[25] 0.17286723 -2.01612827 1.44579209 0.21485968 0.78995241 0.03841527
[31] -0.21640101 -1.10161938 0.70904839 0.47046758 1.41929116 -1.77612180
[37] -0.27091582 0.34132359 1.15063640 -1.06643621 -0.57804827 0.26943355
[43] 1.09267714 0.60277228 -1.96203827 0.47638237 0.39069087 1.40359207
[49] -0.85576822 -0.91479823 1.51247654 0.92996425 0.79617193 -0.97884895
[55] -0.05160747 1.11615193 -0.33394182 -0.78012508 1.36165644 -1.15018357
[61] -0.71884354 2.13266717 -0.71710088 1.30935555 0.54481846 0.49947220
[67] 0.18115268 -1.48930548 1.79180236 -1.70283216 -1.61662577 -1.70942663
[73] 0.46849685 0.58661426 -0.43366233 0.83838047 -0.54183524 -1.30635516
[79] 0.78883823 -0.40967451 0.12360600 -0.67316908 -0.06745759 0.57625076
[85] -1.19985489 -1.21199907 1.79680177 0.84028767 0.42478697 -0.91285219
[91] 0.17825778 0.81817433 -0.73305086 -1.06081783 1.16704062 0.76954207
[97] -1.76187163 -0.15925258 0.82743834 -0.12602590
> rowMin(tmp2)
[1] -0.39361643 -0.22119319 0.49664934 -1.31707798 0.16768383 0.71508706
[7] -1.65834019 -0.93086871 -1.09434518 1.04165400 -2.46491630 0.60963723
[13] 1.07761631 0.25890456 -1.45696317 0.12967202 0.68882113 0.05851153
[19] -0.10000124 -0.83866088 -0.48381935 1.99488775 1.60565694 -0.22459772
[25] 0.17286723 -2.01612827 1.44579209 0.21485968 0.78995241 0.03841527
[31] -0.21640101 -1.10161938 0.70904839 0.47046758 1.41929116 -1.77612180
[37] -0.27091582 0.34132359 1.15063640 -1.06643621 -0.57804827 0.26943355
[43] 1.09267714 0.60277228 -1.96203827 0.47638237 0.39069087 1.40359207
[49] -0.85576822 -0.91479823 1.51247654 0.92996425 0.79617193 -0.97884895
[55] -0.05160747 1.11615193 -0.33394182 -0.78012508 1.36165644 -1.15018357
[61] -0.71884354 2.13266717 -0.71710088 1.30935555 0.54481846 0.49947220
[67] 0.18115268 -1.48930548 1.79180236 -1.70283216 -1.61662577 -1.70942663
[73] 0.46849685 0.58661426 -0.43366233 0.83838047 -0.54183524 -1.30635516
[79] 0.78883823 -0.40967451 0.12360600 -0.67316908 -0.06745759 0.57625076
[85] -1.19985489 -1.21199907 1.79680177 0.84028767 0.42478697 -0.91285219
[91] 0.17825778 0.81817433 -0.73305086 -1.06081783 1.16704062 0.76954207
[97] -1.76187163 -0.15925258 0.82743834 -0.12602590
>
> colMeans(tmp2)
[1] -0.01576207
> colSums(tmp2)
[1] -1.576207
> colVars(tmp2)
[1] 1.065891
> colSd(tmp2)
[1] 1.03242
> colMax(tmp2)
[1] 2.132667
> colMin(tmp2)
[1] -2.464916
> colMedians(tmp2)
[1] 0.126639
> colRanges(tmp2)
[,1]
[1,] -2.464916
[2,] 2.132667
>
> 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.86261708 -2.29568819 -3.60555682 -0.91309719 0.04656466 0.17738921
[7] 0.16004309 3.24239361 -4.09882199 -2.87686630
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.7417078
[2,] -1.0777589
[3,] -0.3751031
[4,] 0.3722761
[5,] 2.6183736
>
> rowApply(tmp,sum)
[1] 3.9318459 -2.3284788 -3.9609539 -2.0120181 -0.6790876 -4.7400944
[7] -1.6784354 0.3462959 0.7322074 -1.6375381
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 8 6 5 9 7 2 10 2 9
[2,] 2 9 9 10 6 4 1 6 7 3
[3,] 10 1 2 1 5 8 4 3 8 7
[4,] 7 5 4 7 1 5 9 5 5 6
[5,] 6 3 7 4 7 1 10 8 3 5
[6,] 9 10 10 9 3 3 8 1 1 8
[7,] 8 7 3 8 2 9 5 4 9 10
[8,] 4 6 8 2 10 6 6 9 6 2
[9,] 3 2 1 3 8 10 3 7 4 4
[10,] 5 4 5 6 4 2 7 2 10 1
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 2.9602845 1.0788725 -4.7767423 -3.6428452 -1.6255240 3.4907178
[7] -1.5505546 -1.7249921 -1.1052700 0.2022933 1.0564464 -0.5222244
[13] -4.2649867 -0.3098583 1.7282051 -1.2358192 0.0910785 -3.4699164
[19] 2.9543870 -4.1730006
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.8123693
[2,] -0.1340609
[3,] 0.4082280
[4,] 0.6182359
[5,] 2.8802508
>
> rowApply(tmp,sum)
[1] 1.971276 -6.562901 -1.806622 -4.226714 -4.214487
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 13 11 7 20 18
[2,] 11 17 13 13 17
[3,] 12 15 1 4 2
[4,] 1 4 19 11 1
[5,] 8 7 17 6 9
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.4082280 0.08968366 0.22206047 -1.6282954 -0.3116427 1.6885374
[2,] -0.1340609 0.42762136 0.04670312 -1.3497838 -0.6190216 0.3114767
[3,] -0.8123693 0.16977239 -1.75048572 1.1623877 0.4860154 0.4370609
[4,] 2.8802508 -0.06587863 -1.65119267 -0.1663057 -0.9866895 1.5053393
[5,] 0.6182359 0.45767376 -1.64382754 -1.6608481 -0.1941856 -0.4516965
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.4234489 0.9477854 -1.3189331 -0.129143125 0.65837273 -1.2331526
[2,] -0.5757865 -0.2012537 0.8524582 0.009899444 -0.12659035 1.2524256
[3,] 0.2015478 0.1129949 0.1162450 0.100346101 -1.13092611 -0.9031789
[4,] -0.9339385 -2.0321581 -0.6187332 -0.411129285 -0.08979838 1.3852115
[5,] 0.1810714 -0.5523606 -0.1363069 0.632320139 1.74538850 -1.0235300
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.4566990 1.1392914 0.8952433 -0.75051375 0.9790988 -0.8823501
[2,] -1.0696022 -1.6343060 0.7558476 -0.50050675 -1.3612012 -1.5348788
[3,] -1.2305928 1.1082715 2.2612178 0.38647242 -1.0868602 -0.2727548
[4,] -1.1965769 0.4971847 -2.4363995 -0.30452996 1.2684554 0.4947005
[5,] -0.3115158 -1.4202999 0.2522960 -0.06674116 0.2915857 -1.2746331
[,19] [,20]
[1,] 2.27312383 -0.1959699
[2,] -0.06831973 -1.0440218
[3,] 0.16624898 -1.3280351
[4,] 0.45954828 -1.8240744
[5,] 0.12378569 0.2191006
>
>
> 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 : 652 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.2113606 0.0507538 -0.1834612 0.04137772 -0.8399486 -0.8345962 -0.6708003
col8 col9 col10 col11 col12 col13 col14
row1 -0.8834648 -2.533474 0.1771061 -0.427815 -0.137181 -0.9364021 0.005881961
col15 col16 col17 col18 col19 col20
row1 -0.3254057 1.609281 1.378187 0.1530983 1.116928 0.1781447
> tmp[,"col10"]
col10
row1 0.177106104
row2 1.733935837
row3 1.884512582
row4 -0.023880340
row5 -0.006093723
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 0.2113606 0.0507538 -0.18346116 0.04137772 -0.8399486 -0.8345962
row5 -1.3850992 0.2201697 -0.05004537 -0.22417006 0.4765534 0.7167244
col7 col8 col9 col10 col11 col12
row1 -0.6708003 -0.8834648 -2.533474 0.177106104 -0.4278150 -0.137181
row5 -0.6546988 1.4071512 -2.117974 -0.006093723 -0.3259338 -1.148744
col13 col14 col15 col16 col17 col18 col19
row1 -0.9364021 0.005881961 -0.3254057 1.6092810 1.378187 0.1530983 1.116928
row5 -0.7065745 -0.144473853 -0.8692461 -0.8957313 0.180063 0.3362706 -1.124287
col20
row1 0.1781447
row5 -0.7838690
> tmp[,c("col6","col20")]
col6 col20
row1 -0.8345962 0.1781447
row2 0.7031089 -1.1520440
row3 0.1012860 -1.2051325
row4 -1.4552110 -0.7927503
row5 0.7167244 -0.7838690
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.8345962 0.1781447
row5 0.7167244 -0.7838690
>
>
>
>
> 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.29508 49.08828 49.9701 50.68297 49.97345 103.3608 51.82932 50.91637
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.18615 49.32851 49.19773 50.89892 50.15402 50.97988 48.19409 47.83833
col17 col18 col19 col20
row1 50.8577 50.23219 49.89451 103.5076
> tmp[,"col10"]
col10
row1 49.32851
row2 30.72186
row3 29.37631
row4 31.26818
row5 49.27653
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.29508 49.08828 49.97010 50.68297 49.97345 103.3608 51.82932 50.91637
row5 50.27637 50.24982 50.78827 50.53663 49.92296 105.2400 50.11718 50.09351
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.18615 49.32851 49.19773 50.89892 50.15402 50.97988 48.19409 47.83833
row5 47.62372 49.27653 51.25975 50.18762 51.01019 50.56903 49.82946 49.39755
col17 col18 col19 col20
row1 50.85770 50.23219 49.89451 103.5076
row5 48.37294 47.47480 49.30307 104.6926
> tmp[,c("col6","col20")]
col6 col20
row1 103.36083 103.50763
row2 73.54022 75.17055
row3 74.63663 75.32306
row4 74.81108 74.72565
row5 105.24001 104.69261
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 103.3608 103.5076
row5 105.2400 104.6926
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 103.3608 103.5076
row5 105.2400 104.6926
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.5734045
[2,] 0.5578971
[3,] 1.2586208
[4,] -0.9220526
[5,] 1.2210023
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.7280212 -0.40581414
[2,] -0.9693817 0.08750151
[3,] 0.8971665 -1.36391271
[4,] 0.5792772 1.53802401
[5,] -0.1190865 -0.22505077
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.8185490 2.0276221
[2,] -0.5769517 -1.8068563
[3,] 1.2644778 -0.8512620
[4,] -1.0583123 1.6143718
[5,] -0.5543042 -0.2383612
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.818549
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.8185490
[2,] -0.5769517
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row3 -0.6208764 1.6460230 0.2969066 0.3923068 1.0385579 -0.3826536 1.624602
row1 0.9440827 -0.5403974 1.0199940 0.7779340 0.4397545 -0.2859242 -1.770436
[,8] [,9] [,10] [,11] [,12] [,13]
row3 1.8643576 -2.0034903 1.2659158 -0.6272078 -0.2536111 0.4823048
row1 -0.6125537 -0.5969474 -0.1080895 -0.7714268 0.2764857 -1.1691644
[,14] [,15] [,16] [,17] [,18] [,19]
row3 -0.01254008 0.36793434 -0.6881156 1.26487654 -0.9528881 -0.9083781
row1 1.32581424 0.01505692 -0.3807544 0.08866368 -0.5095976 -0.7991801
[,20]
row3 -1.57270639
row1 -0.02625711
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 1.397821 1.703514 0.7994926 1.253853 -0.6711182 -1.157549 -0.2165811
[,8] [,9] [,10]
row2 -0.4696329 1.209967 0.3469891
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 1.547581 -0.5145015 -1.533742 -0.03390659 0.7724898 -0.9676834 -1.8231
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.638353 0.9257145 -0.1258607 0.1507807 0.5532217 0.3826641 -1.546749
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.003193304 0.5105498 -0.3674542 0.488116 0.8924329 1.404363
>
>
> 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: 0x616701c6d430>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1baf0b378e0498"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1baf0be909bc6"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1baf0bbb30d9c"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1baf0b343bef6a"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1baf0b7d0dedc2"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1baf0b301a6299"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1baf0b7676cc67"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1baf0b5cd13fc4"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1baf0b66a2a646"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1baf0bc1a7fd7"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1baf0b4809e41d"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1baf0b2d4f89ee"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1baf0b6bb459ef"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1baf0b1eca1f12"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1baf0b4b9652ea"
>
>
> ### 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: 0x6166ffb91080>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6166ffb91080>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x6166ffb91080>
> rowMedians(tmp)
[1] 3.767626e-01 -4.644005e-01 -6.172317e-02 2.842673e-02 3.999294e-01
[6] 1.342376e-01 7.724186e-02 -2.130753e-01 -6.810631e-01 2.350694e-01
[11] 2.980994e-01 2.781028e-01 1.212736e-01 2.483975e-01 -3.170310e-01
[16] -3.210776e-01 -5.457254e-01 -1.558902e-01 1.718495e-02 1.130262e-01
[21] -4.795887e-01 8.556436e-02 6.968962e-02 -1.216852e-01 -5.490429e-01
[26] 6.034819e-01 -1.162866e-01 -1.656816e-01 -4.137839e-02 5.049015e-01
[31] 2.072710e-01 -1.625686e-01 1.794897e-02 9.998192e-02 -5.856635e-02
[36] 4.253235e-01 -5.080532e-01 8.401805e-01 -2.661992e-01 -1.564962e-01
[41] -6.800639e-01 -1.571987e-01 1.481689e-01 -1.194140e-01 -2.660286e-01
[46] -2.192128e-01 3.093638e-01 -1.697853e-01 -1.644216e-01 -7.198643e-03
[51] -1.283388e-01 -7.985660e-02 -1.357287e-01 1.335696e-01 2.339762e-01
[56] 6.936357e-02 4.865363e-01 7.937824e-01 4.051174e-01 -1.907784e-01
[61] 1.132488e-01 4.421978e-01 -2.616980e-01 -5.032106e-01 3.403679e-01
[66] -3.692922e-01 8.604649e-01 -5.349625e-02 3.925899e-01 2.012312e-01
[71] -8.232654e-02 1.344465e-01 -2.168974e-01 -1.170504e-02 -7.154426e-02
[76] -1.255752e-01 -2.283843e-01 -5.001545e-01 -1.231372e-01 -4.623863e-01
[81] 2.071401e-01 -2.383762e-01 -1.826931e-02 3.255858e-02 -1.203646e-02
[86] 2.667483e-01 2.950855e-01 5.741573e-01 7.435014e-01 2.804411e-01
[91] -3.653858e-01 2.446323e-01 1.863094e-01 -3.788996e-01 3.234512e-01
[96] -2.429507e-01 -9.657135e-02 1.235314e-01 2.197614e-01 -9.437294e-03
[101] 5.578041e-01 2.105345e-01 -8.266149e-02 -3.842931e-01 -2.222317e-01
[106] -3.520828e-01 2.119140e-01 2.819094e-01 4.429297e-03 -3.057724e-02
[111] 2.136901e-01 4.764813e-02 -3.841344e-01 -2.722690e-01 1.207780e-01
[116] -1.080746e-01 -4.228598e-01 4.686271e-01 -3.594304e-01 -1.153086e-01
[121] -1.836510e-01 -2.567275e-01 -1.394327e-01 -1.220328e-01 2.556508e-01
[126] 2.348896e-01 -2.936608e-01 2.694910e-01 -2.636655e-02 7.587824e-01
[131] 3.920020e-01 3.172789e-01 -4.351844e-02 4.494692e-02 4.055908e-01
[136] 1.570301e-01 2.621761e-01 1.458004e-01 2.337487e-01 -1.981193e-01
[141] -1.485730e-01 3.862912e-01 -1.962670e-01 -5.314284e-02 -2.076862e-01
[146] 1.216807e-03 -3.020011e-01 -6.303380e-01 1.162899e-02 -1.295692e-01
[151] 2.949597e-01 7.686119e-02 -2.178147e-01 -3.895041e-01 -6.302518e-02
[156] 3.066274e-01 -3.937058e-01 3.493875e-01 4.810732e-01 2.627424e-02
[161] 9.377480e-02 5.460298e-01 -7.024883e-01 2.565549e-01 1.539618e-01
[166] -1.466570e-01 2.179389e-01 -3.814666e-01 3.908038e-01 9.069373e-02
[171] -1.640718e-01 7.026390e-02 5.424814e-01 5.039648e-03 7.772097e-02
[176] 3.909604e-01 -2.581985e-01 1.103028e-01 -2.698211e-01 -2.672303e-01
[181] -2.406261e-01 -1.609989e-02 -1.035244e+00 -5.137772e-01 -1.293857e-01
[186] -2.550785e-01 -8.402222e-03 1.620254e-01 3.000779e-01 7.485789e-02
[191] 8.411155e-02 -1.515186e-01 6.453081e-01 1.029863e-01 4.928901e-01
[196] 6.577227e-02 -2.334980e-01 -3.262908e-01 4.406082e-01 2.491845e-01
[201] -9.956894e-02 4.223421e-01 -1.155036e-02 -6.973520e-02 -2.485638e-06
[206] -1.130521e-01 7.269724e-01 1.399318e-01 -9.220014e-02 1.128798e-01
[211] -8.028499e-02 2.097817e-01 -2.007548e-01 6.899264e-01 3.950344e-01
[216] 2.655089e-02 2.618404e-01 -4.364333e-01 1.869904e-01 -3.840613e-02
[221] 2.325797e-01 1.255020e-01 4.516129e-01 3.475491e-01 -5.458408e-01
[226] 2.160621e-01 3.068934e-01 1.492073e-01 1.581177e-01 2.513670e-02
>
> proc.time()
user system elapsed
1.307 1.456 2.747
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.6.0 alpha (2026-03-30 r89742)
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: 0x632a864fc720>
> .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: 0x632a864fc720>
> .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: 0x632a864fc720>
> .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: 0x632a864fc720>
> 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: 0x632a871e3290>
> .Call("R_bm_AddColumn",P)
<pointer: 0x632a871e3290>
> .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: 0x632a871e3290>
> .Call("R_bm_AddColumn",P)
<pointer: 0x632a871e3290>
> .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: 0x632a871e3290>
> 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: 0x632a85ea0610>
> .Call("R_bm_AddColumn",P)
<pointer: 0x632a85ea0610>
> .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: 0x632a85ea0610>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x632a85ea0610>
> .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: 0x632a85ea0610>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x632a85ea0610>
> .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: 0x632a85ea0610>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x632a85ea0610>
> .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: 0x632a85ea0610>
> 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: 0x632a863b3ac0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x632a863b3ac0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x632a863b3ac0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x632a863b3ac0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1bb14b23852779" "BufferedMatrixFile1bb14b5f4fbe10"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1bb14b23852779" "BufferedMatrixFile1bb14b5f4fbe10"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x632a87030530>
> .Call("R_bm_AddColumn",P)
<pointer: 0x632a87030530>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x632a87030530>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x632a87030530>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x632a87030530>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x632a87030530>
> .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: 0x632a85ac8380>
> .Call("R_bm_AddColumn",P)
<pointer: 0x632a85ac8380>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x632a85ac8380>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x632a85ac8380>
> 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: 0x632a85f953c0>
> .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: 0x632a85f953c0>
> rm(P)
>
> proc.time()
user system elapsed
0.242 0.051 0.279
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.6.0 alpha (2026-03-30 r89742)
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.242 0.043 0.274