| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-01-10 11:34 -0500 (Sat, 10 Jan 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences" | 4818 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2025-11-04 r88984) -- "Unsuffered Consequences" | 4594 |
| 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 253/2332 | 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 | |||||||||
|
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-01-09 21:34:25 -0500 (Fri, 09 Jan 2026) |
| EndedAt: 2026-01-09 21:34:50 -0500 (Fri, 09 Jan 2026) |
| EllapsedTime: 25.1 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2025-12-22 r89219)
* 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.3 LTS
* using session charset: UTF-8
* 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) 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) 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) (2025-12-22 r89219) -- "Unsuffered Consequences"
Copyright (C) 2025 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.250 0.051 0.290
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences"
Copyright (C) 2025 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 478851 25.6 1048487 56 639317 34.2
Vcells 885659 6.8 8388608 64 2082734 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 Jan 9 21:34:40 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 Jan 9 21:34:40 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: 0x616c416562b0>
>
>
>
> 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 Jan 9 21:34:41 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 Jan 9 21:34:41 2026"
>
> ColMode(tmp2)
<pointer: 0x616c416562b0>
>
>
>
> ### 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.0308950 -0.05408932 -1.3723276 -1.7230764
[2,] 0.8311438 1.31601676 -1.0380471 -0.9876873
[3,] 0.5609291 -1.07151988 1.9377963 1.7417219
[4,] 0.2392167 1.00941210 -0.7043365 -0.3339091
> 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.0308950 0.05408932 1.3723276 1.7230764
[2,] 0.8311438 1.31601676 1.0380471 0.9876873
[3,] 0.5609291 1.07151988 1.9377963 1.7417219
[4,] 0.2392167 1.00941210 0.7043365 0.3339091
> 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.0015446 0.2325711 1.1714639 1.3126601
[2,] 0.9116709 1.1471777 1.0188460 0.9938246
[3,] 0.7489520 1.0351424 1.3920475 1.3197431
[4,] 0.4890978 1.0046950 0.8392476 0.5778487
>
> 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.04634 27.37980 38.08697 39.84968
[2,] 34.94785 37.78779 36.22651 35.92593
[3,] 33.05045 36.42294 40.85827 39.93915
[4,] 30.13019 36.05636 34.09681 31.11240
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x616c41d5d500>
> exp(tmp5)
<pointer: 0x616c41d5d500>
> log(tmp5,2)
<pointer: 0x616c41d5d500>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.4045
> Min(tmp5)
[1] 53.05359
> mean(tmp5)
[1] 71.94281
> Sum(tmp5)
[1] 14388.56
> Var(tmp5)
[1] 853.2786
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 92.94629 69.32577 71.59369 68.82896 68.58917 72.13281 68.59201 71.35732
[9] 69.30545 66.75666
> rowSums(tmp5)
[1] 1858.926 1386.515 1431.874 1376.579 1371.783 1442.656 1371.840 1427.146
[9] 1386.109 1335.133
> rowVars(tmp5)
[1] 7883.20313 65.02547 78.15079 73.88877 40.65940 68.23719
[7] 41.50985 38.78709 72.98288 32.92707
> rowSd(tmp5)
[1] 88.787404 8.063837 8.840294 8.595858 6.376472 8.260581 6.442814
[8] 6.227928 8.543002 5.738211
> rowMax(tmp5)
[1] 468.40447 81.07829 85.04114 90.40012 78.52719 84.48440 79.28935
[8] 83.13525 85.89308 76.38694
> rowMin(tmp5)
[1] 56.98747 53.46829 53.05359 53.98882 58.43013 57.69550 57.39627 58.71499
[9] 56.00480 59.42397
>
> colMeans(tmp5)
[1] 108.19627 67.39530 70.47855 73.57997 73.13826 71.33504 71.72693
[8] 65.35756 68.58927 71.18818 70.09910 69.33194 69.63876 69.61595
[15] 69.03345 71.59559 75.49046 62.94229 69.94098 70.18241
> colSums(tmp5)
[1] 1081.9627 673.9530 704.7855 735.7997 731.3826 713.3504 717.2693
[8] 653.5756 685.8927 711.8818 700.9910 693.3194 696.3876 696.1595
[15] 690.3345 715.9559 754.9046 629.4229 699.4098 701.8241
> colVars(tmp5)
[1] 16036.77641 55.10784 76.97757 48.45732 32.39923 45.85094
[7] 43.98011 69.60976 34.64270 57.72854 68.95590 57.72325
[13] 52.98643 77.53313 64.70723 58.67915 19.08869 81.34628
[19] 74.34744 113.29539
> colSd(tmp5)
[1] 126.636394 7.423466 8.773687 6.961129 5.692032 6.771332
[7] 6.631750 8.343247 5.885805 7.597930 8.303969 7.597582
[13] 7.279178 8.805290 8.044081 7.660232 4.369061 9.019217
[19] 8.622496 10.644031
> colMax(tmp5)
[1] 468.40447 78.65034 85.04114 83.12811 80.41320 82.89349 80.89576
[8] 83.13525 77.85527 90.40012 80.05344 79.02244 82.90886 81.04115
[15] 80.35109 85.89308 81.07829 82.54819 84.07871 91.57680
> colMin(tmp5)
[1] 62.34786 56.98747 56.00480 64.75638 61.63905 59.55298 61.12392 53.98882
[9] 59.42397 64.24794 53.46829 53.05359 59.47762 56.13147 58.66965 60.55965
[17] 66.61795 56.24832 58.27069 59.36215
>
>
> ### 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] 92.94629 69.32577 71.59369 68.82896 NA 72.13281 68.59201 71.35732
[9] 69.30545 66.75666
> rowSums(tmp5)
[1] 1858.926 1386.515 1431.874 1376.579 NA 1442.656 1371.840 1427.146
[9] 1386.109 1335.133
> rowVars(tmp5)
[1] 7883.20313 65.02547 78.15079 73.88877 37.96196 68.23719
[7] 41.50985 38.78709 72.98288 32.92707
> rowSd(tmp5)
[1] 88.787404 8.063837 8.840294 8.595858 6.161327 8.260581 6.442814
[8] 6.227928 8.543002 5.738211
> rowMax(tmp5)
[1] 468.40447 81.07829 85.04114 90.40012 NA 84.48440 79.28935
[8] 83.13525 85.89308 76.38694
> rowMin(tmp5)
[1] 56.98747 53.46829 53.05359 53.98882 NA 57.69550 57.39627 58.71499
[9] 56.00480 59.42397
>
> colMeans(tmp5)
[1] 108.19627 67.39530 70.47855 73.57997 73.13826 71.33504 71.72693
[8] 65.35756 68.58927 71.18818 70.09910 69.33194 69.63876 69.61595
[15] NA 71.59559 75.49046 62.94229 69.94098 70.18241
> colSums(tmp5)
[1] 1081.9627 673.9530 704.7855 735.7997 731.3826 713.3504 717.2693
[8] 653.5756 685.8927 711.8818 700.9910 693.3194 696.3876 696.1595
[15] NA 715.9559 754.9046 629.4229 699.4098 701.8241
> colVars(tmp5)
[1] 16036.77641 55.10784 76.97757 48.45732 32.39923 45.85094
[7] 43.98011 69.60976 34.64270 57.72854 68.95590 57.72325
[13] 52.98643 77.53313 NA 58.67915 19.08869 81.34628
[19] 74.34744 113.29539
> colSd(tmp5)
[1] 126.636394 7.423466 8.773687 6.961129 5.692032 6.771332
[7] 6.631750 8.343247 5.885805 7.597930 8.303969 7.597582
[13] 7.279178 8.805290 NA 7.660232 4.369061 9.019217
[19] 8.622496 10.644031
> colMax(tmp5)
[1] 468.40447 78.65034 85.04114 83.12811 80.41320 82.89349 80.89576
[8] 83.13525 77.85527 90.40012 80.05344 79.02244 82.90886 81.04115
[15] NA 85.89308 81.07829 82.54819 84.07871 91.57680
> colMin(tmp5)
[1] 62.34786 56.98747 56.00480 64.75638 61.63905 59.55298 61.12392 53.98882
[9] 59.42397 64.24794 53.46829 53.05359 59.47762 56.13147 NA 60.55965
[17] 66.61795 56.24832 58.27069 59.36215
>
> Max(tmp5,na.rm=TRUE)
[1] 468.4045
> Min(tmp5,na.rm=TRUE)
[1] 53.05359
> mean(tmp5,na.rm=TRUE)
[1] 71.9134
> Sum(tmp5,na.rm=TRUE)
[1] 14310.77
> Var(tmp5,na.rm=TRUE)
[1] 857.4142
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 92.94629 69.32577 71.59369 68.82896 68.10464 72.13281 68.59201 71.35732
[9] 69.30545 66.75666
> rowSums(tmp5,na.rm=TRUE)
[1] 1858.926 1386.515 1431.874 1376.579 1293.988 1442.656 1371.840 1427.146
[9] 1386.109 1335.133
> rowVars(tmp5,na.rm=TRUE)
[1] 7883.20313 65.02547 78.15079 73.88877 37.96196 68.23719
[7] 41.50985 38.78709 72.98288 32.92707
> rowSd(tmp5,na.rm=TRUE)
[1] 88.787404 8.063837 8.840294 8.595858 6.161327 8.260581 6.442814
[8] 6.227928 8.543002 5.738211
> rowMax(tmp5,na.rm=TRUE)
[1] 468.40447 81.07829 85.04114 90.40012 78.52719 84.48440 79.28935
[8] 83.13525 85.89308 76.38694
> rowMin(tmp5,na.rm=TRUE)
[1] 56.98747 53.46829 53.05359 53.98882 58.43013 57.69550 57.39627 58.71499
[9] 56.00480 59.42397
>
> colMeans(tmp5,na.rm=TRUE)
[1] 108.19627 67.39530 70.47855 73.57997 73.13826 71.33504 71.72693
[8] 65.35756 68.58927 71.18818 70.09910 69.33194 69.63876 69.61595
[15] 68.05991 71.59559 75.49046 62.94229 69.94098 70.18241
> colSums(tmp5,na.rm=TRUE)
[1] 1081.9627 673.9530 704.7855 735.7997 731.3826 713.3504 717.2693
[8] 653.5756 685.8927 711.8818 700.9910 693.3194 696.3876 696.1595
[15] 612.5392 715.9559 754.9046 629.4229 699.4098 701.8241
> colVars(tmp5,na.rm=TRUE)
[1] 16036.77641 55.10784 76.97757 48.45732 32.39923 45.85094
[7] 43.98011 69.60976 34.64270 57.72854 68.95590 57.72325
[13] 52.98643 77.53313 62.13315 58.67915 19.08869 81.34628
[19] 74.34744 113.29539
> colSd(tmp5,na.rm=TRUE)
[1] 126.636394 7.423466 8.773687 6.961129 5.692032 6.771332
[7] 6.631750 8.343247 5.885805 7.597930 8.303969 7.597582
[13] 7.279178 8.805290 7.882458 7.660232 4.369061 9.019217
[19] 8.622496 10.644031
> colMax(tmp5,na.rm=TRUE)
[1] 468.40447 78.65034 85.04114 83.12811 80.41320 82.89349 80.89576
[8] 83.13525 77.85527 90.40012 80.05344 79.02244 82.90886 81.04115
[15] 80.35109 85.89308 81.07829 82.54819 84.07871 91.57680
> colMin(tmp5,na.rm=TRUE)
[1] 62.34786 56.98747 56.00480 64.75638 61.63905 59.55298 61.12392 53.98882
[9] 59.42397 64.24794 53.46829 53.05359 59.47762 56.13147 58.66965 60.55965
[17] 66.61795 56.24832 58.27069 59.36215
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 92.94629 69.32577 71.59369 68.82896 NaN 72.13281 68.59201 71.35732
[9] 69.30545 66.75666
> rowSums(tmp5,na.rm=TRUE)
[1] 1858.926 1386.515 1431.874 1376.579 0.000 1442.656 1371.840 1427.146
[9] 1386.109 1335.133
> rowVars(tmp5,na.rm=TRUE)
[1] 7883.20313 65.02547 78.15079 73.88877 NA 68.23719
[7] 41.50985 38.78709 72.98288 32.92707
> rowSd(tmp5,na.rm=TRUE)
[1] 88.787404 8.063837 8.840294 8.595858 NA 8.260581 6.442814
[8] 6.227928 8.543002 5.738211
> rowMax(tmp5,na.rm=TRUE)
[1] 468.40447 81.07829 85.04114 90.40012 NA 84.48440 79.28935
[8] 83.13525 85.89308 76.38694
> rowMin(tmp5,na.rm=TRUE)
[1] 56.98747 53.46829 53.05359 53.98882 NA 57.69550 57.39627 58.71499
[9] 56.00480 59.42397
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 112.29947 68.39143 71.60809 73.03028 72.89968 71.17873 71.76781
[8] 64.45764 69.29270 71.95931 70.48456 68.82448 70.76777 70.46974
[15] NaN 71.29463 75.74664 62.66769 70.74393 70.36430
> colSums(tmp5,na.rm=TRUE)
[1] 1010.6952 615.5229 644.4728 657.2725 656.0971 640.6086 645.9103
[8] 580.1188 623.6343 647.6338 634.3611 619.4203 636.9100 634.2277
[15] 0.0000 641.6517 681.7197 564.0092 636.6954 633.2787
> colVars(tmp5,na.rm=TRUE)
[1] 17851.96597 50.83322 72.24644 51.11518 35.80874 51.30745
[7] 49.45882 69.20009 33.40642 58.25476 75.90381 62.04155
[13] 45.26963 79.02398 NA 64.99503 20.73647 90.66627
[19] 76.38767 127.08511
> colSd(tmp5,na.rm=TRUE)
[1] 133.611249 7.129742 8.499790 7.149488 5.984041 7.162922
[7] 7.032697 8.318659 5.779828 7.632481 8.712279 7.876646
[13] 6.728271 8.889543 NA 8.061950 4.553732 9.521884
[19] 8.740004 11.273203
> colMax(tmp5,na.rm=TRUE)
[1] 468.40447 78.65034 85.04114 83.12811 80.41320 82.89349 80.89576
[8] 83.13525 77.85527 90.40012 80.05344 79.02244 82.90886 81.04115
[15] -Inf 85.89308 81.07829 82.54819 84.07871 91.57680
> colMin(tmp5,na.rm=TRUE)
[1] 62.34786 56.98747 56.00480 64.75638 61.63905 59.55298 61.12392 53.98882
[9] 59.42397 65.66548 53.46829 53.05359 61.08566 56.13147 Inf 60.55965
[17] 66.61795 56.24832 58.27069 59.36215
>
>
>
>
> 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] 288.8558 316.5053 317.3772 134.0846 137.1112 238.9029 213.3163 162.6416
[9] 389.9237 289.3538
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 288.8558 316.5053 317.3772 134.0846 137.1112 238.9029 213.3163 162.6416
[9] 389.9237 289.3538
>
>
>
> 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 2.273737e-13 0.000000e+00 -1.421085e-14 -5.684342e-14
[6] -5.684342e-14 0.000000e+00 -4.263256e-14 -8.526513e-14 5.684342e-14
[11] 1.421085e-14 0.000000e+00 -5.684342e-13 2.842171e-14 9.947598e-14
[16] -5.684342e-14 0.000000e+00 1.421085e-13 1.136868e-13 -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)
+ }
6 5
9 8
6 18
4 13
5 10
7 20
8 1
5 19
9 20
9 11
8 10
8 3
7 6
1 14
3 14
5 2
1 9
7 4
6 7
3 3
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.237839
> Min(tmp)
[1] -2.110015
> mean(tmp)
[1] -0.1140059
> Sum(tmp)
[1] -11.40059
> Var(tmp)
[1] 1.069613
>
> rowMeans(tmp)
[1] -0.1140059
> rowSums(tmp)
[1] -11.40059
> rowVars(tmp)
[1] 1.069613
> rowSd(tmp)
[1] 1.034221
> rowMax(tmp)
[1] 2.237839
> rowMin(tmp)
[1] -2.110015
>
> colMeans(tmp)
[1] -0.156295820 -1.222471022 0.106213249 -1.509283944 -1.602491546
[6] 0.376948230 0.561085083 0.143772726 0.593606531 -0.458002070
[11] -1.262832328 -0.132247346 -1.364545066 0.561430181 1.210945177
[16] -0.268187894 1.513068441 -0.097778396 -0.252304859 -0.911179660
[21] 0.289750035 -0.089730582 -1.584109369 0.093412783 1.366407551
[26] 0.542411441 -1.332900863 1.940346036 -1.476119152 -1.762667997
[31] -1.200330040 -0.527536408 -0.814377189 -0.552715583 1.081485559
[36] -0.444447695 1.066878375 -1.766752190 -1.504752361 1.378282412
[41] -0.078203071 0.689843457 -0.168313222 -0.122318998 -0.003275381
[46] -0.071873132 -0.956772007 -0.152280352 -0.693408905 0.111741610
[51] -0.850125822 -0.259307464 -0.376448526 1.877422292 0.741670417
[56] 1.476251236 1.828694353 -1.452784944 -1.229339244 2.066100822
[61] -0.280131768 -1.283176005 -0.034368737 -1.345051614 0.424477955
[66] 0.192091758 -0.265493250 0.340873381 0.633665478 -1.563360580
[71] 0.091136474 -0.243335557 -1.226207760 -0.160029324 -0.028520509
[76] 0.922025987 0.086931775 1.387562390 -2.067734400 -0.911993892
[81] 0.399319112 0.871427748 1.156142659 0.330839439 -0.900187890
[86] -1.657801830 0.457243996 2.237839047 -0.367853198 -2.110014630
[91] 0.308527139 -0.139507358 -1.821002746 1.300358227 0.101825053
[96] 1.454598976 -0.585689258 -0.983513187 -0.455868169 1.424111848
> colSums(tmp)
[1] -0.156295820 -1.222471022 0.106213249 -1.509283944 -1.602491546
[6] 0.376948230 0.561085083 0.143772726 0.593606531 -0.458002070
[11] -1.262832328 -0.132247346 -1.364545066 0.561430181 1.210945177
[16] -0.268187894 1.513068441 -0.097778396 -0.252304859 -0.911179660
[21] 0.289750035 -0.089730582 -1.584109369 0.093412783 1.366407551
[26] 0.542411441 -1.332900863 1.940346036 -1.476119152 -1.762667997
[31] -1.200330040 -0.527536408 -0.814377189 -0.552715583 1.081485559
[36] -0.444447695 1.066878375 -1.766752190 -1.504752361 1.378282412
[41] -0.078203071 0.689843457 -0.168313222 -0.122318998 -0.003275381
[46] -0.071873132 -0.956772007 -0.152280352 -0.693408905 0.111741610
[51] -0.850125822 -0.259307464 -0.376448526 1.877422292 0.741670417
[56] 1.476251236 1.828694353 -1.452784944 -1.229339244 2.066100822
[61] -0.280131768 -1.283176005 -0.034368737 -1.345051614 0.424477955
[66] 0.192091758 -0.265493250 0.340873381 0.633665478 -1.563360580
[71] 0.091136474 -0.243335557 -1.226207760 -0.160029324 -0.028520509
[76] 0.922025987 0.086931775 1.387562390 -2.067734400 -0.911993892
[81] 0.399319112 0.871427748 1.156142659 0.330839439 -0.900187890
[86] -1.657801830 0.457243996 2.237839047 -0.367853198 -2.110014630
[91] 0.308527139 -0.139507358 -1.821002746 1.300358227 0.101825053
[96] 1.454598976 -0.585689258 -0.983513187 -0.455868169 1.424111848
> 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.156295820 -1.222471022 0.106213249 -1.509283944 -1.602491546
[6] 0.376948230 0.561085083 0.143772726 0.593606531 -0.458002070
[11] -1.262832328 -0.132247346 -1.364545066 0.561430181 1.210945177
[16] -0.268187894 1.513068441 -0.097778396 -0.252304859 -0.911179660
[21] 0.289750035 -0.089730582 -1.584109369 0.093412783 1.366407551
[26] 0.542411441 -1.332900863 1.940346036 -1.476119152 -1.762667997
[31] -1.200330040 -0.527536408 -0.814377189 -0.552715583 1.081485559
[36] -0.444447695 1.066878375 -1.766752190 -1.504752361 1.378282412
[41] -0.078203071 0.689843457 -0.168313222 -0.122318998 -0.003275381
[46] -0.071873132 -0.956772007 -0.152280352 -0.693408905 0.111741610
[51] -0.850125822 -0.259307464 -0.376448526 1.877422292 0.741670417
[56] 1.476251236 1.828694353 -1.452784944 -1.229339244 2.066100822
[61] -0.280131768 -1.283176005 -0.034368737 -1.345051614 0.424477955
[66] 0.192091758 -0.265493250 0.340873381 0.633665478 -1.563360580
[71] 0.091136474 -0.243335557 -1.226207760 -0.160029324 -0.028520509
[76] 0.922025987 0.086931775 1.387562390 -2.067734400 -0.911993892
[81] 0.399319112 0.871427748 1.156142659 0.330839439 -0.900187890
[86] -1.657801830 0.457243996 2.237839047 -0.367853198 -2.110014630
[91] 0.308527139 -0.139507358 -1.821002746 1.300358227 0.101825053
[96] 1.454598976 -0.585689258 -0.983513187 -0.455868169 1.424111848
> colMin(tmp)
[1] -0.156295820 -1.222471022 0.106213249 -1.509283944 -1.602491546
[6] 0.376948230 0.561085083 0.143772726 0.593606531 -0.458002070
[11] -1.262832328 -0.132247346 -1.364545066 0.561430181 1.210945177
[16] -0.268187894 1.513068441 -0.097778396 -0.252304859 -0.911179660
[21] 0.289750035 -0.089730582 -1.584109369 0.093412783 1.366407551
[26] 0.542411441 -1.332900863 1.940346036 -1.476119152 -1.762667997
[31] -1.200330040 -0.527536408 -0.814377189 -0.552715583 1.081485559
[36] -0.444447695 1.066878375 -1.766752190 -1.504752361 1.378282412
[41] -0.078203071 0.689843457 -0.168313222 -0.122318998 -0.003275381
[46] -0.071873132 -0.956772007 -0.152280352 -0.693408905 0.111741610
[51] -0.850125822 -0.259307464 -0.376448526 1.877422292 0.741670417
[56] 1.476251236 1.828694353 -1.452784944 -1.229339244 2.066100822
[61] -0.280131768 -1.283176005 -0.034368737 -1.345051614 0.424477955
[66] 0.192091758 -0.265493250 0.340873381 0.633665478 -1.563360580
[71] 0.091136474 -0.243335557 -1.226207760 -0.160029324 -0.028520509
[76] 0.922025987 0.086931775 1.387562390 -2.067734400 -0.911993892
[81] 0.399319112 0.871427748 1.156142659 0.330839439 -0.900187890
[86] -1.657801830 0.457243996 2.237839047 -0.367853198 -2.110014630
[91] 0.308527139 -0.139507358 -1.821002746 1.300358227 0.101825053
[96] 1.454598976 -0.585689258 -0.983513187 -0.455868169 1.424111848
> colMedians(tmp)
[1] -0.156295820 -1.222471022 0.106213249 -1.509283944 -1.602491546
[6] 0.376948230 0.561085083 0.143772726 0.593606531 -0.458002070
[11] -1.262832328 -0.132247346 -1.364545066 0.561430181 1.210945177
[16] -0.268187894 1.513068441 -0.097778396 -0.252304859 -0.911179660
[21] 0.289750035 -0.089730582 -1.584109369 0.093412783 1.366407551
[26] 0.542411441 -1.332900863 1.940346036 -1.476119152 -1.762667997
[31] -1.200330040 -0.527536408 -0.814377189 -0.552715583 1.081485559
[36] -0.444447695 1.066878375 -1.766752190 -1.504752361 1.378282412
[41] -0.078203071 0.689843457 -0.168313222 -0.122318998 -0.003275381
[46] -0.071873132 -0.956772007 -0.152280352 -0.693408905 0.111741610
[51] -0.850125822 -0.259307464 -0.376448526 1.877422292 0.741670417
[56] 1.476251236 1.828694353 -1.452784944 -1.229339244 2.066100822
[61] -0.280131768 -1.283176005 -0.034368737 -1.345051614 0.424477955
[66] 0.192091758 -0.265493250 0.340873381 0.633665478 -1.563360580
[71] 0.091136474 -0.243335557 -1.226207760 -0.160029324 -0.028520509
[76] 0.922025987 0.086931775 1.387562390 -2.067734400 -0.911993892
[81] 0.399319112 0.871427748 1.156142659 0.330839439 -0.900187890
[86] -1.657801830 0.457243996 2.237839047 -0.367853198 -2.110014630
[91] 0.308527139 -0.139507358 -1.821002746 1.300358227 0.101825053
[96] 1.454598976 -0.585689258 -0.983513187 -0.455868169 1.424111848
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.1562958 -1.222471 0.1062132 -1.509284 -1.602492 0.3769482 0.5610851
[2,] -0.1562958 -1.222471 0.1062132 -1.509284 -1.602492 0.3769482 0.5610851
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.1437727 0.5936065 -0.4580021 -1.262832 -0.1322473 -1.364545 0.5614302
[2,] 0.1437727 0.5936065 -0.4580021 -1.262832 -0.1322473 -1.364545 0.5614302
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 1.210945 -0.2681879 1.513068 -0.0977784 -0.2523049 -0.9111797 0.28975
[2,] 1.210945 -0.2681879 1.513068 -0.0977784 -0.2523049 -0.9111797 0.28975
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.08973058 -1.584109 0.09341278 1.366408 0.5424114 -1.332901 1.940346
[2,] -0.08973058 -1.584109 0.09341278 1.366408 0.5424114 -1.332901 1.940346
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -1.476119 -1.762668 -1.20033 -0.5275364 -0.8143772 -0.5527156 1.081486
[2,] -1.476119 -1.762668 -1.20033 -0.5275364 -0.8143772 -0.5527156 1.081486
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.4444477 1.066878 -1.766752 -1.504752 1.378282 -0.07820307 0.6898435
[2,] -0.4444477 1.066878 -1.766752 -1.504752 1.378282 -0.07820307 0.6898435
[,43] [,44] [,45] [,46] [,47] [,48]
[1,] -0.1683132 -0.122319 -0.003275381 -0.07187313 -0.956772 -0.1522804
[2,] -0.1683132 -0.122319 -0.003275381 -0.07187313 -0.956772 -0.1522804
[,49] [,50] [,51] [,52] [,53] [,54] [,55]
[1,] -0.6934089 0.1117416 -0.8501258 -0.2593075 -0.3764485 1.877422 0.7416704
[2,] -0.6934089 0.1117416 -0.8501258 -0.2593075 -0.3764485 1.877422 0.7416704
[,56] [,57] [,58] [,59] [,60] [,61] [,62]
[1,] 1.476251 1.828694 -1.452785 -1.229339 2.066101 -0.2801318 -1.283176
[2,] 1.476251 1.828694 -1.452785 -1.229339 2.066101 -0.2801318 -1.283176
[,63] [,64] [,65] [,66] [,67] [,68] [,69]
[1,] -0.03436874 -1.345052 0.424478 0.1920918 -0.2654933 0.3408734 0.6336655
[2,] -0.03436874 -1.345052 0.424478 0.1920918 -0.2654933 0.3408734 0.6336655
[,70] [,71] [,72] [,73] [,74] [,75] [,76]
[1,] -1.563361 0.09113647 -0.2433356 -1.226208 -0.1600293 -0.02852051 0.922026
[2,] -1.563361 0.09113647 -0.2433356 -1.226208 -0.1600293 -0.02852051 0.922026
[,77] [,78] [,79] [,80] [,81] [,82] [,83]
[1,] 0.08693177 1.387562 -2.067734 -0.9119939 0.3993191 0.8714277 1.156143
[2,] 0.08693177 1.387562 -2.067734 -0.9119939 0.3993191 0.8714277 1.156143
[,84] [,85] [,86] [,87] [,88] [,89] [,90]
[1,] 0.3308394 -0.9001879 -1.657802 0.457244 2.237839 -0.3678532 -2.110015
[2,] 0.3308394 -0.9001879 -1.657802 0.457244 2.237839 -0.3678532 -2.110015
[,91] [,92] [,93] [,94] [,95] [,96] [,97]
[1,] 0.3085271 -0.1395074 -1.821003 1.300358 0.1018251 1.454599 -0.5856893
[2,] 0.3085271 -0.1395074 -1.821003 1.300358 0.1018251 1.454599 -0.5856893
[,98] [,99] [,100]
[1,] -0.9835132 -0.4558682 1.424112
[2,] -0.9835132 -0.4558682 1.424112
>
>
> Max(tmp2)
[1] 2.938672
> Min(tmp2)
[1] -3.177791
> mean(tmp2)
[1] -0.01441998
> Sum(tmp2)
[1] -1.441998
> Var(tmp2)
[1] 1.115145
>
> rowMeans(tmp2)
[1] 0.693329151 1.106545615 -0.766386639 -0.016747597 -0.730163426
[6] -1.090746762 -0.678809687 0.456116825 1.094889330 -0.392523313
[11] 0.052560009 0.454429136 2.510899123 0.443104260 1.345432318
[16] -0.411475932 -0.887405673 0.237437767 -0.158698656 1.326404672
[21] -0.216554460 -0.304815284 -1.235742527 -1.951986792 2.084849147
[26] -0.796399984 2.938671909 0.002437489 1.580282728 -0.606722930
[31] 0.703241554 -1.047395748 -0.468057874 -0.047602157 0.169221078
[36] -1.058701820 1.277353637 0.516309043 -0.701670849 0.062329020
[41] 0.052301320 -0.150693015 0.576878234 1.130841950 1.285891556
[46] -1.697169890 0.051613797 -1.158240398 0.601688769 -0.411184642
[51] -0.686515413 -0.224468401 -0.689692897 -1.066576937 1.483539966
[56] -1.196891644 -0.421162972 -0.044535337 -1.007540283 0.179708793
[61] 1.654646290 0.608635074 -0.970206734 -0.423455211 1.172188756
[66] -1.015486392 -0.134650817 -0.815491992 0.799213735 0.404279323
[71] 0.965793321 -1.031996485 -0.176404312 -2.098416419 -1.558916780
[76] 0.305776078 -1.227041926 1.353758742 -0.209961446 0.581699508
[81] -0.174438174 -0.127886432 0.661073532 -0.357923820 0.792324024
[86] -0.734850950 -1.522776340 -0.203963277 -0.309740157 2.407552537
[91] 1.496373645 -0.124553006 -0.088517424 -3.177791098 -0.176355983
[96] -0.903553379 1.888012712 -0.320772434 -1.539218834 0.796016265
> rowSums(tmp2)
[1] 0.693329151 1.106545615 -0.766386639 -0.016747597 -0.730163426
[6] -1.090746762 -0.678809687 0.456116825 1.094889330 -0.392523313
[11] 0.052560009 0.454429136 2.510899123 0.443104260 1.345432318
[16] -0.411475932 -0.887405673 0.237437767 -0.158698656 1.326404672
[21] -0.216554460 -0.304815284 -1.235742527 -1.951986792 2.084849147
[26] -0.796399984 2.938671909 0.002437489 1.580282728 -0.606722930
[31] 0.703241554 -1.047395748 -0.468057874 -0.047602157 0.169221078
[36] -1.058701820 1.277353637 0.516309043 -0.701670849 0.062329020
[41] 0.052301320 -0.150693015 0.576878234 1.130841950 1.285891556
[46] -1.697169890 0.051613797 -1.158240398 0.601688769 -0.411184642
[51] -0.686515413 -0.224468401 -0.689692897 -1.066576937 1.483539966
[56] -1.196891644 -0.421162972 -0.044535337 -1.007540283 0.179708793
[61] 1.654646290 0.608635074 -0.970206734 -0.423455211 1.172188756
[66] -1.015486392 -0.134650817 -0.815491992 0.799213735 0.404279323
[71] 0.965793321 -1.031996485 -0.176404312 -2.098416419 -1.558916780
[76] 0.305776078 -1.227041926 1.353758742 -0.209961446 0.581699508
[81] -0.174438174 -0.127886432 0.661073532 -0.357923820 0.792324024
[86] -0.734850950 -1.522776340 -0.203963277 -0.309740157 2.407552537
[91] 1.496373645 -0.124553006 -0.088517424 -3.177791098 -0.176355983
[96] -0.903553379 1.888012712 -0.320772434 -1.539218834 0.796016265
> 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.693329151 1.106545615 -0.766386639 -0.016747597 -0.730163426
[6] -1.090746762 -0.678809687 0.456116825 1.094889330 -0.392523313
[11] 0.052560009 0.454429136 2.510899123 0.443104260 1.345432318
[16] -0.411475932 -0.887405673 0.237437767 -0.158698656 1.326404672
[21] -0.216554460 -0.304815284 -1.235742527 -1.951986792 2.084849147
[26] -0.796399984 2.938671909 0.002437489 1.580282728 -0.606722930
[31] 0.703241554 -1.047395748 -0.468057874 -0.047602157 0.169221078
[36] -1.058701820 1.277353637 0.516309043 -0.701670849 0.062329020
[41] 0.052301320 -0.150693015 0.576878234 1.130841950 1.285891556
[46] -1.697169890 0.051613797 -1.158240398 0.601688769 -0.411184642
[51] -0.686515413 -0.224468401 -0.689692897 -1.066576937 1.483539966
[56] -1.196891644 -0.421162972 -0.044535337 -1.007540283 0.179708793
[61] 1.654646290 0.608635074 -0.970206734 -0.423455211 1.172188756
[66] -1.015486392 -0.134650817 -0.815491992 0.799213735 0.404279323
[71] 0.965793321 -1.031996485 -0.176404312 -2.098416419 -1.558916780
[76] 0.305776078 -1.227041926 1.353758742 -0.209961446 0.581699508
[81] -0.174438174 -0.127886432 0.661073532 -0.357923820 0.792324024
[86] -0.734850950 -1.522776340 -0.203963277 -0.309740157 2.407552537
[91] 1.496373645 -0.124553006 -0.088517424 -3.177791098 -0.176355983
[96] -0.903553379 1.888012712 -0.320772434 -1.539218834 0.796016265
> rowMin(tmp2)
[1] 0.693329151 1.106545615 -0.766386639 -0.016747597 -0.730163426
[6] -1.090746762 -0.678809687 0.456116825 1.094889330 -0.392523313
[11] 0.052560009 0.454429136 2.510899123 0.443104260 1.345432318
[16] -0.411475932 -0.887405673 0.237437767 -0.158698656 1.326404672
[21] -0.216554460 -0.304815284 -1.235742527 -1.951986792 2.084849147
[26] -0.796399984 2.938671909 0.002437489 1.580282728 -0.606722930
[31] 0.703241554 -1.047395748 -0.468057874 -0.047602157 0.169221078
[36] -1.058701820 1.277353637 0.516309043 -0.701670849 0.062329020
[41] 0.052301320 -0.150693015 0.576878234 1.130841950 1.285891556
[46] -1.697169890 0.051613797 -1.158240398 0.601688769 -0.411184642
[51] -0.686515413 -0.224468401 -0.689692897 -1.066576937 1.483539966
[56] -1.196891644 -0.421162972 -0.044535337 -1.007540283 0.179708793
[61] 1.654646290 0.608635074 -0.970206734 -0.423455211 1.172188756
[66] -1.015486392 -0.134650817 -0.815491992 0.799213735 0.404279323
[71] 0.965793321 -1.031996485 -0.176404312 -2.098416419 -1.558916780
[76] 0.305776078 -1.227041926 1.353758742 -0.209961446 0.581699508
[81] -0.174438174 -0.127886432 0.661073532 -0.357923820 0.792324024
[86] -0.734850950 -1.522776340 -0.203963277 -0.309740157 2.407552537
[91] 1.496373645 -0.124553006 -0.088517424 -3.177791098 -0.176355983
[96] -0.903553379 1.888012712 -0.320772434 -1.539218834 0.796016265
>
> colMeans(tmp2)
[1] -0.01441998
> colSums(tmp2)
[1] -1.441998
> colVars(tmp2)
[1] 1.115145
> colSd(tmp2)
[1] 1.056004
> colMax(tmp2)
[1] 2.938672
> colMin(tmp2)
[1] -3.177791
> colMedians(tmp2)
[1] -0.1426719
> colRanges(tmp2)
[,1]
[1,] -3.177791
[2,] 2.938672
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] -0.41087989 -0.10499286 3.17970235 0.06893822 -3.58287845 0.92511598
[7] -5.93434100 2.85754665 -1.42971060 0.90671372
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.05342517
[2,] -0.75422592
[3,] -0.09914851
[4,] 0.44955513
[5,] 1.59799264
>
> rowApply(tmp,sum)
[1] -3.4751620 0.6713826 3.9466834 2.3496206 -2.0482234 -0.4676294
[7] -1.1637672 0.2858091 1.9372727 -5.5607723
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 3 5 10 7 7 3 8 3 8 6
[2,] 1 7 9 4 9 2 2 7 4 9
[3,] 10 6 6 3 3 9 9 9 6 5
[4,] 2 2 5 9 6 10 10 6 7 8
[5,] 8 4 1 2 1 1 3 2 3 10
[6,] 7 9 2 5 10 4 7 4 5 1
[7,] 4 8 4 6 2 6 6 1 1 2
[8,] 9 3 8 8 5 7 1 10 9 3
[9,] 5 10 3 10 4 5 4 5 2 4
[10,] 6 1 7 1 8 8 5 8 10 7
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 4.74107751 -1.10275765 -0.07586569 5.05139526 -2.06975323 4.99352691
[7] 6.05791879 1.33400285 -0.07318042 -3.90391977 -0.10725897 0.60981745
[13] 0.30818651 -2.04142127 0.61518407 1.94823103 -0.93285278 0.36106385
[19] -0.70590030 -2.51273586
> colApply(tmp,quantile)[,1]
[,1]
[1,] 0.4982618
[2,] 0.4986779
[3,] 0.9684679
[4,] 1.2904741
[5,] 1.4851958
>
> rowApply(tmp,sum)
[1] 4.5316433 -0.8672885 5.8793872 -1.6568722 4.6078885
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 15 16 19 13 19
[2,] 14 13 15 6 1
[3,] 8 14 12 4 10
[4,] 16 19 16 15 13
[5,] 6 3 7 3 16
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.9684679 0.82289495 0.10280954 1.0057937 -0.3691155 2.0500580
[2,] 0.4986779 -0.07026741 -0.03842973 1.6170170 -0.7953311 -0.7759433
[3,] 1.4851958 0.82433372 0.30614883 1.0572903 -0.3406112 1.3153111
[4,] 0.4982618 -0.55991741 -0.61312427 0.5589411 -1.5283843 1.3662054
[5,] 1.2904741 -2.11980151 0.16672993 0.8123532 0.9636888 1.0378956
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 1.4726551 1.0203997 -1.13212640 -0.75937979 0.73172468 -0.8909236
[2,] 1.6560785 1.2448360 0.71618969 -0.27750858 -0.66527553 -0.2697910
[3,] 0.3588759 -0.8548661 0.78751681 -0.01352622 0.18706865 2.7346280
[4,] 1.2460683 0.5192759 -0.39949798 -1.99258896 -0.39176283 -0.1540640
[5,] 1.3242410 -0.5956426 -0.04526254 -0.86091622 0.03098605 -0.8100319
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.36533094 0.67430406 1.3575415 -0.2841330 -1.9470715 0.42397558
[2,] -0.27342687 -0.37832086 -0.5430992 -0.9797408 0.1918827 -0.32681421
[3,] 0.07077843 -0.83709087 -0.7169649 1.2336354 -0.3632649 -0.62391196
[4,] 0.07150360 -1.56802128 -0.4238205 0.9042100 0.6636156 -0.06851335
[5,] 0.07400040 0.06770768 0.9415271 1.0742594 0.5219853 0.95632779
[,19] [,20]
[1,] 0.1047101 -1.1862726
[2,] -0.3362400 -1.0617818
[3,] -0.5944478 -0.1367117
[4,] -0.5752406 0.7899815
[5,] 0.6953180 -0.9179511
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 654 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 565 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 0.3404563 -0.9990189 -0.6370212 0.935319 -0.5223434 0.3843614 -0.2492988
col8 col9 col10 col11 col12 col13 col14
row1 -0.1699539 -1.146111 0.7092111 0.1473276 1.212746 -0.4165229 0.5642276
col15 col16 col17 col18 col19 col20
row1 0.8074427 0.7283312 0.2054032 0.7223134 0.0002508678 -0.7932566
> tmp[,"col10"]
col10
row1 0.7092111
row2 0.9432137
row3 1.7467535
row4 0.4212524
row5 -0.3999698
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 0.3404563 -0.9990189 -0.6370212 0.935319 -0.5223434 0.3843614 -0.2492988
row5 -0.1695310 0.4246596 -1.1563294 1.136204 -1.5393218 0.7722404 2.7170801
col8 col9 col10 col11 col12 col13
row1 -0.1699539 -1.1461106 0.7092111 0.1473276 1.2127457 -0.4165229
row5 -0.1427567 0.9964073 -0.3999698 -1.5490008 -0.2343068 1.0023189
col14 col15 col16 col17 col18 col19
row1 0.5642276 0.8074427 0.7283312 0.2054032 0.7223134 0.0002508678
row5 0.7832711 -2.2996089 0.3401666 0.5574751 1.4429680 -0.2073190614
col20
row1 -0.7932566
row5 0.7378897
> tmp[,c("col6","col20")]
col6 col20
row1 0.3843614 -0.7932566
row2 0.6126318 -0.5129985
row3 -0.9201672 -0.6571800
row4 -1.9849063 1.8847166
row5 0.7722404 0.7378897
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.3843614 -0.7932566
row5 0.7722404 0.7378897
>
>
>
>
> 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 51.29182 50.30632 49.92936 49.59682 50.25364 107.5602 49.36757 50.90797
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.79212 49.00815 48.60386 50.96113 48.29091 50.38443 51.61947 51.07662
col17 col18 col19 col20
row1 48.70006 49.05736 49.93073 105.7351
> tmp[,"col10"]
col10
row1 49.00815
row2 30.91065
row3 29.84823
row4 30.55242
row5 48.50948
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 51.29182 50.30632 49.92936 49.59682 50.25364 107.5602 49.36757 50.90797
row5 51.03412 50.84931 49.66382 48.48488 49.16332 104.6958 49.59409 48.90474
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.79212 49.00815 48.60386 50.96113 48.29091 50.38443 51.61947 51.07662
row5 50.96038 48.50948 49.31329 50.33280 49.90817 49.75015 50.51264 51.02954
col17 col18 col19 col20
row1 48.70006 49.05736 49.93073 105.7351
row5 49.91235 48.74389 48.69353 105.4630
> tmp[,c("col6","col20")]
col6 col20
row1 107.56015 105.73513
row2 75.98291 74.50538
row3 75.74361 75.51407
row4 75.54013 74.36004
row5 104.69582 105.46298
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 107.5602 105.7351
row5 104.6958 105.4630
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 107.5602 105.7351
row5 104.6958 105.4630
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.60819305
[2,] 0.06657412
[3,] -0.41512293
[4,] 0.77318073
[5,] 1.06200405
> tmp[,c("col17","col7")]
col17 col7
[1,] -1.1049293 -0.2053616
[2,] -1.3107308 -0.3159438
[3,] -0.1254434 -0.4281556
[4,] -0.4426047 -1.7684836
[5,] 1.5125462 -0.2305305
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.7026080 -0.8590763
[2,] 0.9769658 0.6160088
[3,] -1.1307180 1.0095823
[4,] 0.8036703 0.9448959
[5,] 0.5161042 0.3703760
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.702608
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.7026080
[2,] 0.9769658
>
>
>
> 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.9540821 0.4255545 -0.114662 -0.5886563 -0.6848272 1.076590 -1.2640164
row1 -1.5248625 0.6427439 1.369500 0.5667409 1.5190039 -1.963001 0.6906052
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 3.282684 -0.8198493 -1.069650 1.4818890 -1.366843 -1.364060 -0.2373888
row1 -0.314186 -0.6231011 -0.066395 0.2051435 -1.440902 1.626167 -0.1964286
[,15] [,16] [,17] [,18] [,19] [,20]
row3 -1.0361752 1.153774 -0.4764518 0.6482887 -1.684173 -1.15673351
row1 0.6236141 0.762096 0.1559146 -0.1337196 -1.811978 -0.09373994
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -1.362935 -0.0560168 0.7227781 0.04103587 -1.172146 0.02118693 -0.5255237
[,8] [,9] [,10]
row2 0.4626051 0.4484412 1.482956
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 1.832993 -1.309107 0.7038545 0.1316893 -0.05487978 0.3466308 -1.827507
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.0953261 -0.9451605 -2.268937 0.6541517 -1.947347 -1.246831 -0.720012
[,15] [,16] [,17] [,18] [,19] [,20]
row5 1.978056 -0.7772426 0.3372187 -0.7079263 0.1800159 -0.1342162
>
>
> 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: 0x616c42d99c30>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM299998b2cc06d"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM299998530d14f5"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2999987a0abafe"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM299998739c290"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM29999845de4802"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2999984b85f6ee"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM29999845070575"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2999986b24cfea"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM299998727c776d"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM29999850a37289"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2999983e8856a6"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2999983a638ffb"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM299998624ed2a4"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2999982cab8aba"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM29999829277fa5"
>
>
> ### 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: 0x616c40ec65f0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x616c40ec65f0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x616c40ec65f0>
> rowMedians(tmp)
[1] -0.014800691 0.305051715 -0.312999431 0.097478288 -0.515652424
[6] -0.116222429 0.232135216 0.013227196 0.501289298 -0.143716598
[11] -0.473107168 -0.669508696 0.187637003 0.546480522 0.449276969
[16] 0.099996994 -0.146702576 0.427587913 -0.048483505 0.058198371
[21] -0.183428487 -0.126900054 -0.165659799 -0.201229765 0.338443536
[26] -0.125990198 -0.156269074 0.145607293 -0.247521879 0.356434591
[31] 0.197400887 -0.431681302 -0.547677069 -0.080000879 -0.609442061
[36] -0.391501652 0.131328532 -0.224580958 -0.040105439 0.002625793
[41] -0.029048449 0.054496343 -0.805023467 -0.067559213 -0.019878385
[46] -0.459362314 -0.022009078 0.341147929 -0.131864064 -0.566357691
[51] -0.176333477 0.503900967 -0.646003588 0.029882260 0.022094259
[56] 0.683545920 0.120129593 0.284014268 0.045241185 -0.076401746
[61] -0.453554237 0.089559830 0.049578069 -0.553258398 -0.029782514
[66] 0.324175575 0.077837016 0.208083851 0.524692414 0.052825466
[71] 0.258561917 -0.667373698 -0.538379144 -0.156873714 0.050472455
[76] 0.145576236 0.393900775 -0.095294411 0.125071374 0.085206278
[81] -0.060606936 -0.060053472 0.094919595 -0.349230271 0.131729205
[86] 0.063730521 0.019415535 -0.168560597 0.554925209 -0.503244801
[91] 0.021301613 -0.259387456 -0.421281243 -0.020471963 0.151683950
[96] 0.529072158 -0.041172993 0.148659297 0.383572984 -0.323528527
[101] 0.155153073 0.380489653 -0.548667891 0.944126994 -0.090287337
[106] -0.124484064 0.615935168 -0.058881063 -0.414108952 0.082931286
[111] -0.508731393 -0.007822315 -0.011662882 0.232463062 0.117977013
[116] -0.383113349 -0.176453900 0.170541792 -0.002615440 -0.510462540
[121] 0.024454590 0.317079609 -0.096557779 -0.344566966 -0.022207742
[126] 0.302945649 0.444820024 0.192465410 -0.150364326 -0.417153953
[131] 0.023721829 -0.138987650 -0.020081596 -0.673801000 -0.189886650
[136] -0.461650503 -0.380464770 -0.387759204 -0.049080284 -0.935340469
[141] -0.166782667 0.349847182 -0.315744199 0.429903774 -0.191010276
[146] 0.340111013 0.237112042 0.289802820 -0.163309403 0.049828156
[151] -0.146848455 -0.565260394 0.037320229 -0.704889949 0.077268897
[156] -0.449770552 0.263862413 0.081677950 0.351273870 0.266010454
[161] -0.553614562 0.092515687 -0.649366781 0.396502268 0.114783540
[166] 0.072307937 0.172711197 -0.344780077 0.049317014 -0.530040198
[171] -0.293591458 -0.524773285 -0.076745420 -0.178919059 -0.035009686
[176] 0.182041010 0.539918353 0.190584827 0.068551940 0.204204787
[181] -0.253332275 0.134610658 -0.177821645 -0.060810979 -0.284211933
[186] 0.040658099 -0.420973804 -0.181256941 -0.306757538 0.614687628
[191] 0.130644908 0.107357936 -0.425563498 0.140505123 -0.410697605
[196] 0.105243262 0.033510705 0.315117885 0.468036651 -0.034025962
[201] -0.092175143 0.152792420 0.314167426 -0.272194122 -0.167232109
[206] -0.400110282 -0.531985558 -0.172222997 -0.075529123 0.094690653
[211] 0.348250605 0.377432726 0.532148492 -0.557831164 0.542826760
[216] -0.310849760 0.073903048 -0.094743508 0.255477451 0.288012634
[221] -0.185746791 0.296121432 0.255293882 -0.195179141 -0.377739731
[226] 0.107247338 -0.232857868 0.090736276 -0.219515055 -0.333412537
>
> proc.time()
user system elapsed
1.390 1.443 2.819
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences"
Copyright (C) 2025 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: 0x6036eb3d45f0>
> .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: 0x6036eb3d45f0>
> .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: 0x6036eb3d45f0>
> .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: 0x6036eb3d45f0>
> 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: 0x6036ebc522b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6036ebc522b0>
> .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: 0x6036ebc522b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6036ebc522b0>
> .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: 0x6036ebc522b0>
> 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: 0x6036eb335a20>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6036eb335a20>
> .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: 0x6036eb335a20>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6036eb335a20>
> .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: 0x6036eb335a20>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x6036eb335a20>
> .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: 0x6036eb335a20>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x6036eb335a20>
> .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: 0x6036eb335a20>
> 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: 0x6036ebb12e00>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6036ebb12e00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6036ebb12e00>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6036ebb12e00>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile299ad05ced2d71" "BufferedMatrixFile299ad07f76ec07"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile299ad05ced2d71" "BufferedMatrixFile299ad07f76ec07"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6036eba1a4c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6036eba1a4c0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6036eba1a4c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6036eba1a4c0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6036eba1a4c0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6036eba1a4c0>
> .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: 0x6036ebdc37e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6036ebdc37e0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6036ebdc37e0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6036ebdc37e0>
> 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: 0x6036ece9c520>
> .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: 0x6036ece9c520>
> rm(P)
>
> proc.time()
user system elapsed
0.263 0.059 0.309
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2025-12-22 r89219) -- "Unsuffered Consequences"
Copyright (C) 2025 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.244 0.045 0.278