| Back to Build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-01-31 11:32 -0500 (Sat, 31 Jan 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences" | 4852 |
| 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 254/2347 | 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 | |||||||||
| 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-01-30 21:43:10 -0500 (Fri, 30 Jan 2026) |
| EndedAt: 2026-01-30 21:43:35 -0500 (Fri, 30 Jan 2026) |
| EllapsedTime: 25.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2026-01-15 r89304)
* 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) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.233 0.055 0.277
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478920 25.6 1048721 56.1 639242 34.2
Vcells 885815 6.8 8388608 64.0 2083259 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 30 21:43:25 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 30 21:43:25 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: 0x65513c64fc10>
>
>
>
> 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 30 21:43:25 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 30 21:43:26 2026"
>
> ColMode(tmp2)
<pointer: 0x65513c64fc10>
>
>
>
> ### 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.9184815 -0.09398166 -1.064896 -0.75838368
[2,] 0.2814900 -1.30254687 1.477044 -0.01464194
[3,] 0.3663978 -0.28938463 -1.066688 -0.11742386
[4,] -0.1029263 0.67681563 1.923708 1.04589904
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.9184815 0.09398166 1.064896 0.75838368
[2,] 0.2814900 1.30254687 1.477044 0.01464194
[3,] 0.3663978 0.28938463 1.066688 0.11742386
[4,] 0.1029263 0.67681563 1.923708 1.04589904
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.0458191 0.3065643 1.031938 0.8708523
[2,] 0.5305563 1.1412918 1.215337 0.1210039
[3,] 0.6053080 0.5379448 1.032806 0.3426717
[4,] 0.3208212 0.8226881 1.386978 1.0226921
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 226.37667 28.15962 36.38428 34.46691
[2,] 30.58705 37.71546 38.63041 26.22468
[3,] 31.41948 30.66883 36.39475 28.54414
[4,] 28.31114 33.90370 40.79349 36.27282
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x65513cca9b90>
> exp(tmp5)
<pointer: 0x65513cca9b90>
> log(tmp5,2)
<pointer: 0x65513cca9b90>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.1734
> Min(tmp5)
[1] 53.01861
> mean(tmp5)
[1] 73.28744
> Sum(tmp5)
[1] 14657.49
> Var(tmp5)
[1] 871.6976
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.26596 69.26810 70.51354 70.53360 73.21579 72.26069 70.69888 73.35145
[9] 72.76487 69.00151
> rowSums(tmp5)
[1] 1825.319 1385.362 1410.271 1410.672 1464.316 1445.214 1413.978 1467.029
[9] 1455.297 1380.030
> rowVars(tmp5)
[1] 8051.70237 76.05436 46.25709 92.45499 62.61342 104.58830
[7] 96.23290 70.93271 62.23342 65.69337
> rowSd(tmp5)
[1] 89.731279 8.720915 6.801257 9.615352 7.912864 10.226842 9.809837
[8] 8.422156 7.888816 8.105145
> rowMax(tmp5)
[1] 471.17338 83.87969 85.04175 90.99199 85.96325 89.69527 84.33865
[8] 89.07021 88.47196 89.70324
> rowMin(tmp5)
[1] 54.22504 54.58324 59.41089 55.89113 57.07228 54.15087 53.01861 59.40135
[9] 60.56909 57.34160
>
> colMeans(tmp5)
[1] 108.18068 69.03214 74.96003 69.19429 70.72366 73.90035 71.70806
[8] 72.14422 68.42139 72.61170 75.51608 73.31001 71.05471 71.78269
[15] 72.11315 70.32909 68.37066 71.30298 70.19851 70.89437
> colSums(tmp5)
[1] 1081.8068 690.3214 749.6003 691.9429 707.2366 739.0035 717.0806
[8] 721.4422 684.2139 726.1170 755.1608 733.1001 710.5471 717.8269
[15] 721.1315 703.2909 683.7066 713.0298 701.9851 708.9437
> colVars(tmp5)
[1] 16302.15633 52.01293 65.93230 84.98904 56.37767 73.95850
[7] 79.54739 98.07215 43.79532 59.94122 134.70191 94.41281
[13] 73.98509 46.66510 101.27720 104.13787 94.25195 76.41001
[19] 78.54077 46.58135
> colSd(tmp5)
[1] 127.679898 7.211999 8.119871 9.218950 7.508507 8.599913
[7] 8.918934 9.903138 6.617804 7.742172 11.606115 9.716625
[13] 8.601458 6.831186 10.063658 10.204797 9.708344 8.741282
[19] 8.862323 6.825053
> colMax(tmp5)
[1] 471.17338 78.49980 84.90630 84.85623 82.68790 89.07021 82.50129
[8] 88.47196 76.70742 85.96325 89.70324 87.45165 79.41801 79.40738
[15] 88.41159 90.99199 84.95278 81.99966 89.69527 83.25484
> colMin(tmp5)
[1] 58.92593 58.61057 60.19984 54.58324 59.04902 62.15225 56.74561 54.22504
[9] 57.14500 61.69579 54.04226 55.18960 57.34160 55.89113 59.13932 57.07228
[17] 53.01861 54.15087 58.22978 61.18752
>
>
> ### 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.26596 69.26810 70.51354 NA 73.21579 72.26069 70.69888 73.35145
[9] 72.76487 69.00151
> rowSums(tmp5)
[1] 1825.319 1385.362 1410.271 NA 1464.316 1445.214 1413.978 1467.029
[9] 1455.297 1380.030
> rowVars(tmp5)
[1] 8051.70237 76.05436 46.25709 97.49217 62.61342 104.58830
[7] 96.23290 70.93271 62.23342 65.69337
> rowSd(tmp5)
[1] 89.731279 8.720915 6.801257 9.873812 7.912864 10.226842 9.809837
[8] 8.422156 7.888816 8.105145
> rowMax(tmp5)
[1] 471.17338 83.87969 85.04175 NA 85.96325 89.69527 84.33865
[8] 89.07021 88.47196 89.70324
> rowMin(tmp5)
[1] 54.22504 54.58324 59.41089 NA 57.07228 54.15087 53.01861 59.40135
[9] 60.56909 57.34160
>
> colMeans(tmp5)
[1] 108.18068 69.03214 74.96003 69.19429 70.72366 73.90035 71.70806
[8] 72.14422 68.42139 72.61170 75.51608 73.31001 71.05471 71.78269
[15] 72.11315 70.32909 68.37066 NA 70.19851 70.89437
> colSums(tmp5)
[1] 1081.8068 690.3214 749.6003 691.9429 707.2366 739.0035 717.0806
[8] 721.4422 684.2139 726.1170 755.1608 733.1001 710.5471 717.8269
[15] 721.1315 703.2909 683.7066 NA 701.9851 708.9437
> colVars(tmp5)
[1] 16302.15633 52.01293 65.93230 84.98904 56.37767 73.95850
[7] 79.54739 98.07215 43.79532 59.94122 134.70191 94.41281
[13] 73.98509 46.66510 101.27720 104.13787 94.25195 NA
[19] 78.54077 46.58135
> colSd(tmp5)
[1] 127.679898 7.211999 8.119871 9.218950 7.508507 8.599913
[7] 8.918934 9.903138 6.617804 7.742172 11.606115 9.716625
[13] 8.601458 6.831186 10.063658 10.204797 9.708344 NA
[19] 8.862323 6.825053
> colMax(tmp5)
[1] 471.17338 78.49980 84.90630 84.85623 82.68790 89.07021 82.50129
[8] 88.47196 76.70742 85.96325 89.70324 87.45165 79.41801 79.40738
[15] 88.41159 90.99199 84.95278 NA 89.69527 83.25484
> colMin(tmp5)
[1] 58.92593 58.61057 60.19984 54.58324 59.04902 62.15225 56.74561 54.22504
[9] 57.14500 61.69579 54.04226 55.18960 57.34160 55.89113 59.13932 57.07228
[17] 53.01861 NA 58.22978 61.18752
>
> Max(tmp5,na.rm=TRUE)
[1] 471.1734
> Min(tmp5,na.rm=TRUE)
[1] 53.01861
> mean(tmp5,na.rm=TRUE)
[1] 73.29473
> Sum(tmp5,na.rm=TRUE)
[1] 14585.65
> Var(tmp5,na.rm=TRUE)
[1] 876.0894
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.26596 69.26810 70.51354 70.46505 73.21579 72.26069 70.69888 73.35145
[9] 72.76487 69.00151
> rowSums(tmp5,na.rm=TRUE)
[1] 1825.319 1385.362 1410.271 1338.836 1464.316 1445.214 1413.978 1467.029
[9] 1455.297 1380.030
> rowVars(tmp5,na.rm=TRUE)
[1] 8051.70237 76.05436 46.25709 97.49217 62.61342 104.58830
[7] 96.23290 70.93271 62.23342 65.69337
> rowSd(tmp5,na.rm=TRUE)
[1] 89.731279 8.720915 6.801257 9.873812 7.912864 10.226842 9.809837
[8] 8.422156 7.888816 8.105145
> rowMax(tmp5,na.rm=TRUE)
[1] 471.17338 83.87969 85.04175 90.99199 85.96325 89.69527 84.33865
[8] 89.07021 88.47196 89.70324
> rowMin(tmp5,na.rm=TRUE)
[1] 54.22504 54.58324 59.41089 55.89113 57.07228 54.15087 53.01861 59.40135
[9] 60.56909 57.34160
>
> colMeans(tmp5,na.rm=TRUE)
[1] 108.18068 69.03214 74.96003 69.19429 70.72366 73.90035 71.70806
[8] 72.14422 68.42139 72.61170 75.51608 73.31001 71.05471 71.78269
[15] 72.11315 70.32909 68.37066 71.24374 70.19851 70.89437
> colSums(tmp5,na.rm=TRUE)
[1] 1081.8068 690.3214 749.6003 691.9429 707.2366 739.0035 717.0806
[8] 721.4422 684.2139 726.1170 755.1608 733.1001 710.5471 717.8269
[15] 721.1315 703.2909 683.7066 641.1937 701.9851 708.9437
> colVars(tmp5,na.rm=TRUE)
[1] 16302.15633 52.01293 65.93230 84.98904 56.37767 73.95850
[7] 79.54739 98.07215 43.79532 59.94122 134.70191 94.41281
[13] 73.98509 46.66510 101.27720 104.13787 94.25195 85.92178
[19] 78.54077 46.58135
> colSd(tmp5,na.rm=TRUE)
[1] 127.679898 7.211999 8.119871 9.218950 7.508507 8.599913
[7] 8.918934 9.903138 6.617804 7.742172 11.606115 9.716625
[13] 8.601458 6.831186 10.063658 10.204797 9.708344 9.269400
[19] 8.862323 6.825053
> colMax(tmp5,na.rm=TRUE)
[1] 471.17338 78.49980 84.90630 84.85623 82.68790 89.07021 82.50129
[8] 88.47196 76.70742 85.96325 89.70324 87.45165 79.41801 79.40738
[15] 88.41159 90.99199 84.95278 81.99966 89.69527 83.25484
> colMin(tmp5,na.rm=TRUE)
[1] 58.92593 58.61057 60.19984 54.58324 59.04902 62.15225 56.74561 54.22504
[9] 57.14500 61.69579 54.04226 55.18960 57.34160 55.89113 59.13932 57.07228
[17] 53.01861 54.15087 58.22978 61.18752
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.26596 69.26810 70.51354 NaN 73.21579 72.26069 70.69888 73.35145
[9] 72.76487 69.00151
> rowSums(tmp5,na.rm=TRUE)
[1] 1825.319 1385.362 1410.271 0.000 1464.316 1445.214 1413.978 1467.029
[9] 1455.297 1380.030
> rowVars(tmp5,na.rm=TRUE)
[1] 8051.70237 76.05436 46.25709 NA 62.61342 104.58830
[7] 96.23290 70.93271 62.23342 65.69337
> rowSd(tmp5,na.rm=TRUE)
[1] 89.731279 8.720915 6.801257 NA 7.912864 10.226842 9.809837
[8] 8.422156 7.888816 8.105145
> rowMax(tmp5,na.rm=TRUE)
[1] 471.17338 83.87969 85.04175 NA 85.96325 89.69527 84.33865
[8] 89.07021 88.47196 89.70324
> rowMin(tmp5,na.rm=TRUE)
[1] 54.22504 54.58324 59.41089 NA 57.07228 54.15087 53.01861 59.40135
[9] 60.56909 57.34160
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 113.65343 68.86170 73.85489 68.49398 71.11687 74.22511 71.50266
[8] 72.51292 68.27075 72.86853 76.39242 74.11044 70.33452 73.54842
[15] 70.30221 68.03322 69.53509 NaN 71.52837 71.47916
> colSums(tmp5,na.rm=TRUE)
[1] 1022.8808 619.7553 664.6940 616.4458 640.0518 668.0260 643.5239
[8] 652.6163 614.4368 655.8168 687.5318 666.9940 633.0107 661.9357
[15] 632.7199 612.2990 625.8158 0.0000 643.7554 643.3124
> colVars(tmp5,na.rm=TRUE)
[1] 18002.97718 58.18774 60.43382 90.09522 61.68548 82.01679
[7] 89.01620 108.80189 49.01446 66.69178 142.89989 99.00668
[13] 77.39810 17.42301 77.04251 57.85579 90.77968 NA
[19] 68.46245 48.55687
> colSd(tmp5,na.rm=TRUE)
[1] 134.175174 7.628089 7.773919 9.491850 7.854011 9.056312
[7] 9.434840 10.430814 7.001033 8.166504 11.954074 9.950210
[13] 8.797619 4.174088 8.777387 7.606299 9.527837 NA
[19] 8.274204 6.968276
> colMax(tmp5,na.rm=TRUE)
[1] 471.17338 78.49980 84.33865 84.85623 82.68790 89.07021 82.50129
[8] 88.47196 76.70742 85.96325 89.70324 87.45165 79.41801 79.40738
[15] 84.32034 78.67521 84.95278 -Inf 89.69527 83.25484
> colMin(tmp5,na.rm=TRUE)
[1] 63.66294 58.61057 60.19984 54.58324 59.04902 62.15225 56.74561 54.22504
[9] 57.14500 61.69579 54.04226 55.18960 57.34160 65.28515 59.13932 57.07228
[17] 53.01861 Inf 60.56909 61.18752
>
>
>
>
> 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] 281.1677 175.1798 144.9301 208.6503 261.0986 207.5886 238.4301 222.3116
[9] 268.5205 387.5477
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 281.1677 175.1798 144.9301 208.6503 261.0986 207.5886 238.4301 222.3116
[9] 268.5205 387.5477
>
>
>
> 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 0.000000e+00 -1.136868e-13 2.842171e-14
[6] 2.842171e-14 1.136868e-13 5.684342e-14 -2.842171e-14 1.136868e-13
[11] 5.684342e-14 -5.684342e-14 1.136868e-13 4.263256e-14 -1.136868e-13
[16] 1.136868e-13 1.705303e-13 2.273737e-13 2.842171e-14 -1.705303e-13
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
10 3
3 1
10 18
6 16
7 20
3 17
10 16
8 3
1 16
2 5
1 11
4 11
3 17
3 14
8 19
8 1
5 17
9 14
9 6
1 17
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.475696
> Min(tmp)
[1] -2.76677
> mean(tmp)
[1] 0.07221454
> Sum(tmp)
[1] 7.221454
> Var(tmp)
[1] 1.137653
>
> rowMeans(tmp)
[1] 0.07221454
> rowSums(tmp)
[1] 7.221454
> rowVars(tmp)
[1] 1.137653
> rowSd(tmp)
[1] 1.066608
> rowMax(tmp)
[1] 2.475696
> rowMin(tmp)
[1] -2.76677
>
> colMeans(tmp)
[1] -0.7186786495 0.6571008984 1.8549689808 1.2739440404 1.7647561272
[6] -0.0308637091 -0.8447136898 1.8582579458 1.8524776165 -0.8941593647
[11] 0.3560659833 -0.4486136285 -1.1729767894 1.6411182089 -0.6863220932
[16] -0.7864848373 0.3347728493 1.0219221729 -0.5278198130 -0.9249766546
[21] 0.7860457394 -1.1302450803 -1.1938172798 -1.5226190121 1.8327444604
[26] 0.1773963216 -2.1385484268 0.9875911783 1.5790917685 0.2656788673
[31] -1.7637274083 -2.7667696953 0.3478831177 0.9280152036 -0.7636662345
[36] -0.6925949771 0.3342807672 0.0314082666 -0.4720532626 1.0593245649
[41] 0.0845481968 1.2314159563 0.5953809440 -1.3675992135 -0.8318739259
[46] 0.5031599380 1.0808331571 0.8499874802 -1.1770445056 0.7154117080
[51] 0.3433158631 2.0558856192 1.5326078634 -0.5510171536 0.9902380721
[56] 2.4756957769 0.0003284975 0.0250786466 1.4161578230 0.7838499229
[61] 1.7117790946 -1.1980313015 0.0244796041 0.4037408112 0.6562780053
[66] 0.2150742082 -0.8335460777 0.2591477255 -0.7420007925 0.5856683806
[71] 0.0129924163 1.2754269881 0.3583846379 0.1093254034 1.4191865022
[76] 0.5996823865 -1.5960316630 -2.6380987229 -0.0652690070 -0.4339741874
[81] 0.8972523931 0.2095116280 -0.1227745287 -1.6302083130 0.1039250436
[86] 0.4626489309 -0.1869646120 -1.1708811977 -0.2281774333 -0.6716485167
[91] 0.1514780994 1.1280987666 -0.7015600451 -0.9513292714 -1.2172585581
[96] -0.2948658162 -0.5180700177 0.4243497022 -0.5328720769 -0.2749693245
> colSums(tmp)
[1] -0.7186786495 0.6571008984 1.8549689808 1.2739440404 1.7647561272
[6] -0.0308637091 -0.8447136898 1.8582579458 1.8524776165 -0.8941593647
[11] 0.3560659833 -0.4486136285 -1.1729767894 1.6411182089 -0.6863220932
[16] -0.7864848373 0.3347728493 1.0219221729 -0.5278198130 -0.9249766546
[21] 0.7860457394 -1.1302450803 -1.1938172798 -1.5226190121 1.8327444604
[26] 0.1773963216 -2.1385484268 0.9875911783 1.5790917685 0.2656788673
[31] -1.7637274083 -2.7667696953 0.3478831177 0.9280152036 -0.7636662345
[36] -0.6925949771 0.3342807672 0.0314082666 -0.4720532626 1.0593245649
[41] 0.0845481968 1.2314159563 0.5953809440 -1.3675992135 -0.8318739259
[46] 0.5031599380 1.0808331571 0.8499874802 -1.1770445056 0.7154117080
[51] 0.3433158631 2.0558856192 1.5326078634 -0.5510171536 0.9902380721
[56] 2.4756957769 0.0003284975 0.0250786466 1.4161578230 0.7838499229
[61] 1.7117790946 -1.1980313015 0.0244796041 0.4037408112 0.6562780053
[66] 0.2150742082 -0.8335460777 0.2591477255 -0.7420007925 0.5856683806
[71] 0.0129924163 1.2754269881 0.3583846379 0.1093254034 1.4191865022
[76] 0.5996823865 -1.5960316630 -2.6380987229 -0.0652690070 -0.4339741874
[81] 0.8972523931 0.2095116280 -0.1227745287 -1.6302083130 0.1039250436
[86] 0.4626489309 -0.1869646120 -1.1708811977 -0.2281774333 -0.6716485167
[91] 0.1514780994 1.1280987666 -0.7015600451 -0.9513292714 -1.2172585581
[96] -0.2948658162 -0.5180700177 0.4243497022 -0.5328720769 -0.2749693245
> 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.7186786495 0.6571008984 1.8549689808 1.2739440404 1.7647561272
[6] -0.0308637091 -0.8447136898 1.8582579458 1.8524776165 -0.8941593647
[11] 0.3560659833 -0.4486136285 -1.1729767894 1.6411182089 -0.6863220932
[16] -0.7864848373 0.3347728493 1.0219221729 -0.5278198130 -0.9249766546
[21] 0.7860457394 -1.1302450803 -1.1938172798 -1.5226190121 1.8327444604
[26] 0.1773963216 -2.1385484268 0.9875911783 1.5790917685 0.2656788673
[31] -1.7637274083 -2.7667696953 0.3478831177 0.9280152036 -0.7636662345
[36] -0.6925949771 0.3342807672 0.0314082666 -0.4720532626 1.0593245649
[41] 0.0845481968 1.2314159563 0.5953809440 -1.3675992135 -0.8318739259
[46] 0.5031599380 1.0808331571 0.8499874802 -1.1770445056 0.7154117080
[51] 0.3433158631 2.0558856192 1.5326078634 -0.5510171536 0.9902380721
[56] 2.4756957769 0.0003284975 0.0250786466 1.4161578230 0.7838499229
[61] 1.7117790946 -1.1980313015 0.0244796041 0.4037408112 0.6562780053
[66] 0.2150742082 -0.8335460777 0.2591477255 -0.7420007925 0.5856683806
[71] 0.0129924163 1.2754269881 0.3583846379 0.1093254034 1.4191865022
[76] 0.5996823865 -1.5960316630 -2.6380987229 -0.0652690070 -0.4339741874
[81] 0.8972523931 0.2095116280 -0.1227745287 -1.6302083130 0.1039250436
[86] 0.4626489309 -0.1869646120 -1.1708811977 -0.2281774333 -0.6716485167
[91] 0.1514780994 1.1280987666 -0.7015600451 -0.9513292714 -1.2172585581
[96] -0.2948658162 -0.5180700177 0.4243497022 -0.5328720769 -0.2749693245
> colMin(tmp)
[1] -0.7186786495 0.6571008984 1.8549689808 1.2739440404 1.7647561272
[6] -0.0308637091 -0.8447136898 1.8582579458 1.8524776165 -0.8941593647
[11] 0.3560659833 -0.4486136285 -1.1729767894 1.6411182089 -0.6863220932
[16] -0.7864848373 0.3347728493 1.0219221729 -0.5278198130 -0.9249766546
[21] 0.7860457394 -1.1302450803 -1.1938172798 -1.5226190121 1.8327444604
[26] 0.1773963216 -2.1385484268 0.9875911783 1.5790917685 0.2656788673
[31] -1.7637274083 -2.7667696953 0.3478831177 0.9280152036 -0.7636662345
[36] -0.6925949771 0.3342807672 0.0314082666 -0.4720532626 1.0593245649
[41] 0.0845481968 1.2314159563 0.5953809440 -1.3675992135 -0.8318739259
[46] 0.5031599380 1.0808331571 0.8499874802 -1.1770445056 0.7154117080
[51] 0.3433158631 2.0558856192 1.5326078634 -0.5510171536 0.9902380721
[56] 2.4756957769 0.0003284975 0.0250786466 1.4161578230 0.7838499229
[61] 1.7117790946 -1.1980313015 0.0244796041 0.4037408112 0.6562780053
[66] 0.2150742082 -0.8335460777 0.2591477255 -0.7420007925 0.5856683806
[71] 0.0129924163 1.2754269881 0.3583846379 0.1093254034 1.4191865022
[76] 0.5996823865 -1.5960316630 -2.6380987229 -0.0652690070 -0.4339741874
[81] 0.8972523931 0.2095116280 -0.1227745287 -1.6302083130 0.1039250436
[86] 0.4626489309 -0.1869646120 -1.1708811977 -0.2281774333 -0.6716485167
[91] 0.1514780994 1.1280987666 -0.7015600451 -0.9513292714 -1.2172585581
[96] -0.2948658162 -0.5180700177 0.4243497022 -0.5328720769 -0.2749693245
> colMedians(tmp)
[1] -0.7186786495 0.6571008984 1.8549689808 1.2739440404 1.7647561272
[6] -0.0308637091 -0.8447136898 1.8582579458 1.8524776165 -0.8941593647
[11] 0.3560659833 -0.4486136285 -1.1729767894 1.6411182089 -0.6863220932
[16] -0.7864848373 0.3347728493 1.0219221729 -0.5278198130 -0.9249766546
[21] 0.7860457394 -1.1302450803 -1.1938172798 -1.5226190121 1.8327444604
[26] 0.1773963216 -2.1385484268 0.9875911783 1.5790917685 0.2656788673
[31] -1.7637274083 -2.7667696953 0.3478831177 0.9280152036 -0.7636662345
[36] -0.6925949771 0.3342807672 0.0314082666 -0.4720532626 1.0593245649
[41] 0.0845481968 1.2314159563 0.5953809440 -1.3675992135 -0.8318739259
[46] 0.5031599380 1.0808331571 0.8499874802 -1.1770445056 0.7154117080
[51] 0.3433158631 2.0558856192 1.5326078634 -0.5510171536 0.9902380721
[56] 2.4756957769 0.0003284975 0.0250786466 1.4161578230 0.7838499229
[61] 1.7117790946 -1.1980313015 0.0244796041 0.4037408112 0.6562780053
[66] 0.2150742082 -0.8335460777 0.2591477255 -0.7420007925 0.5856683806
[71] 0.0129924163 1.2754269881 0.3583846379 0.1093254034 1.4191865022
[76] 0.5996823865 -1.5960316630 -2.6380987229 -0.0652690070 -0.4339741874
[81] 0.8972523931 0.2095116280 -0.1227745287 -1.6302083130 0.1039250436
[86] 0.4626489309 -0.1869646120 -1.1708811977 -0.2281774333 -0.6716485167
[91] 0.1514780994 1.1280987666 -0.7015600451 -0.9513292714 -1.2172585581
[96] -0.2948658162 -0.5180700177 0.4243497022 -0.5328720769 -0.2749693245
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.7186786 0.6571009 1.854969 1.273944 1.764756 -0.03086371 -0.8447137
[2,] -0.7186786 0.6571009 1.854969 1.273944 1.764756 -0.03086371 -0.8447137
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 1.858258 1.852478 -0.8941594 0.356066 -0.4486136 -1.172977 1.641118
[2,] 1.858258 1.852478 -0.8941594 0.356066 -0.4486136 -1.172977 1.641118
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.6863221 -0.7864848 0.3347728 1.021922 -0.5278198 -0.9249767 0.7860457
[2,] -0.6863221 -0.7864848 0.3347728 1.021922 -0.5278198 -0.9249767 0.7860457
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -1.130245 -1.193817 -1.522619 1.832744 0.1773963 -2.138548 0.9875912
[2,] -1.130245 -1.193817 -1.522619 1.832744 0.1773963 -2.138548 0.9875912
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 1.579092 0.2656789 -1.763727 -2.76677 0.3478831 0.9280152 -0.7636662
[2,] 1.579092 0.2656789 -1.763727 -2.76677 0.3478831 0.9280152 -0.7636662
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.692595 0.3342808 0.03140827 -0.4720533 1.059325 0.0845482 1.231416
[2,] -0.692595 0.3342808 0.03140827 -0.4720533 1.059325 0.0845482 1.231416
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.5953809 -1.367599 -0.8318739 0.5031599 1.080833 0.8499875 -1.177045
[2,] 0.5953809 -1.367599 -0.8318739 0.5031599 1.080833 0.8499875 -1.177045
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.7154117 0.3433159 2.055886 1.532608 -0.5510172 0.9902381 2.475696
[2,] 0.7154117 0.3433159 2.055886 1.532608 -0.5510172 0.9902381 2.475696
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.0003284975 0.02507865 1.416158 0.7838499 1.711779 -1.198031 0.0244796
[2,] 0.0003284975 0.02507865 1.416158 0.7838499 1.711779 -1.198031 0.0244796
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.4037408 0.656278 0.2150742 -0.8335461 0.2591477 -0.7420008 0.5856684
[2,] 0.4037408 0.656278 0.2150742 -0.8335461 0.2591477 -0.7420008 0.5856684
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.01299242 1.275427 0.3583846 0.1093254 1.419187 0.5996824 -1.596032
[2,] 0.01299242 1.275427 0.3583846 0.1093254 1.419187 0.5996824 -1.596032
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -2.638099 -0.06526901 -0.4339742 0.8972524 0.2095116 -0.1227745 -1.630208
[2,] -2.638099 -0.06526901 -0.4339742 0.8972524 0.2095116 -0.1227745 -1.630208
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 0.103925 0.4626489 -0.1869646 -1.170881 -0.2281774 -0.6716485 0.1514781
[2,] 0.103925 0.4626489 -0.1869646 -1.170881 -0.2281774 -0.6716485 0.1514781
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 1.128099 -0.70156 -0.9513293 -1.217259 -0.2948658 -0.51807 0.4243497
[2,] 1.128099 -0.70156 -0.9513293 -1.217259 -0.2948658 -0.51807 0.4243497
[,99] [,100]
[1,] -0.5328721 -0.2749693
[2,] -0.5328721 -0.2749693
>
>
> Max(tmp2)
[1] 2.585726
> Min(tmp2)
[1] -2.430283
> mean(tmp2)
[1] -0.1262115
> Sum(tmp2)
[1] -12.62115
> Var(tmp2)
[1] 0.7176159
>
> rowMeans(tmp2)
[1] 0.29185707 0.98568828 -0.92589268 -0.41895182 -0.99705961 0.98005282
[7] 0.20758981 0.16599684 0.43884529 0.15323493 0.16548632 -0.32278347
[13] 0.81198349 0.38719486 -0.36210115 -0.89385491 0.13830728 -0.16726199
[19] -0.24547067 -1.11035717 0.31553461 -0.68208638 -1.69727992 -1.27235202
[25] -2.43028317 -0.48677758 0.36075241 -0.41388595 0.17621466 -1.07022057
[31] 1.07974728 0.42025218 2.58572558 -0.71614025 -1.28809451 -0.33867231
[37] -0.48529808 0.77597313 0.18276702 -0.15976933 0.56361693 0.83185879
[43] -0.55193574 0.16981375 0.89083627 1.46739713 0.35713302 -0.32338246
[49] -1.86786855 -0.36755426 -0.23411299 -1.17628043 0.88396207 -1.26122309
[55] -0.26124380 0.46899903 0.69586066 -0.20755653 -0.64650169 -0.92170916
[61] 0.73328239 0.05998919 0.48017809 -1.74292856 -0.20570618 -0.64123565
[67] 0.35834995 -0.94939047 1.29838119 -0.84385055 0.94260958 0.39037214
[73] -1.22328731 -0.79707958 -0.73769251 1.68080407 -0.44035866 -0.34547383
[79] 1.29827274 -0.77131218 -0.61720238 -0.67788872 -0.50676449 0.85960412
[85] -0.46121220 -0.32868127 -0.02106217 -0.52469615 -1.47974667 0.48670247
[91] 0.30900490 -0.01794023 -0.03010401 -0.32582260 1.50983045 0.36677173
[97] -0.94582952 0.22371815 -1.35385693 -0.27861349
> rowSums(tmp2)
[1] 0.29185707 0.98568828 -0.92589268 -0.41895182 -0.99705961 0.98005282
[7] 0.20758981 0.16599684 0.43884529 0.15323493 0.16548632 -0.32278347
[13] 0.81198349 0.38719486 -0.36210115 -0.89385491 0.13830728 -0.16726199
[19] -0.24547067 -1.11035717 0.31553461 -0.68208638 -1.69727992 -1.27235202
[25] -2.43028317 -0.48677758 0.36075241 -0.41388595 0.17621466 -1.07022057
[31] 1.07974728 0.42025218 2.58572558 -0.71614025 -1.28809451 -0.33867231
[37] -0.48529808 0.77597313 0.18276702 -0.15976933 0.56361693 0.83185879
[43] -0.55193574 0.16981375 0.89083627 1.46739713 0.35713302 -0.32338246
[49] -1.86786855 -0.36755426 -0.23411299 -1.17628043 0.88396207 -1.26122309
[55] -0.26124380 0.46899903 0.69586066 -0.20755653 -0.64650169 -0.92170916
[61] 0.73328239 0.05998919 0.48017809 -1.74292856 -0.20570618 -0.64123565
[67] 0.35834995 -0.94939047 1.29838119 -0.84385055 0.94260958 0.39037214
[73] -1.22328731 -0.79707958 -0.73769251 1.68080407 -0.44035866 -0.34547383
[79] 1.29827274 -0.77131218 -0.61720238 -0.67788872 -0.50676449 0.85960412
[85] -0.46121220 -0.32868127 -0.02106217 -0.52469615 -1.47974667 0.48670247
[91] 0.30900490 -0.01794023 -0.03010401 -0.32582260 1.50983045 0.36677173
[97] -0.94582952 0.22371815 -1.35385693 -0.27861349
> 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.29185707 0.98568828 -0.92589268 -0.41895182 -0.99705961 0.98005282
[7] 0.20758981 0.16599684 0.43884529 0.15323493 0.16548632 -0.32278347
[13] 0.81198349 0.38719486 -0.36210115 -0.89385491 0.13830728 -0.16726199
[19] -0.24547067 -1.11035717 0.31553461 -0.68208638 -1.69727992 -1.27235202
[25] -2.43028317 -0.48677758 0.36075241 -0.41388595 0.17621466 -1.07022057
[31] 1.07974728 0.42025218 2.58572558 -0.71614025 -1.28809451 -0.33867231
[37] -0.48529808 0.77597313 0.18276702 -0.15976933 0.56361693 0.83185879
[43] -0.55193574 0.16981375 0.89083627 1.46739713 0.35713302 -0.32338246
[49] -1.86786855 -0.36755426 -0.23411299 -1.17628043 0.88396207 -1.26122309
[55] -0.26124380 0.46899903 0.69586066 -0.20755653 -0.64650169 -0.92170916
[61] 0.73328239 0.05998919 0.48017809 -1.74292856 -0.20570618 -0.64123565
[67] 0.35834995 -0.94939047 1.29838119 -0.84385055 0.94260958 0.39037214
[73] -1.22328731 -0.79707958 -0.73769251 1.68080407 -0.44035866 -0.34547383
[79] 1.29827274 -0.77131218 -0.61720238 -0.67788872 -0.50676449 0.85960412
[85] -0.46121220 -0.32868127 -0.02106217 -0.52469615 -1.47974667 0.48670247
[91] 0.30900490 -0.01794023 -0.03010401 -0.32582260 1.50983045 0.36677173
[97] -0.94582952 0.22371815 -1.35385693 -0.27861349
> rowMin(tmp2)
[1] 0.29185707 0.98568828 -0.92589268 -0.41895182 -0.99705961 0.98005282
[7] 0.20758981 0.16599684 0.43884529 0.15323493 0.16548632 -0.32278347
[13] 0.81198349 0.38719486 -0.36210115 -0.89385491 0.13830728 -0.16726199
[19] -0.24547067 -1.11035717 0.31553461 -0.68208638 -1.69727992 -1.27235202
[25] -2.43028317 -0.48677758 0.36075241 -0.41388595 0.17621466 -1.07022057
[31] 1.07974728 0.42025218 2.58572558 -0.71614025 -1.28809451 -0.33867231
[37] -0.48529808 0.77597313 0.18276702 -0.15976933 0.56361693 0.83185879
[43] -0.55193574 0.16981375 0.89083627 1.46739713 0.35713302 -0.32338246
[49] -1.86786855 -0.36755426 -0.23411299 -1.17628043 0.88396207 -1.26122309
[55] -0.26124380 0.46899903 0.69586066 -0.20755653 -0.64650169 -0.92170916
[61] 0.73328239 0.05998919 0.48017809 -1.74292856 -0.20570618 -0.64123565
[67] 0.35834995 -0.94939047 1.29838119 -0.84385055 0.94260958 0.39037214
[73] -1.22328731 -0.79707958 -0.73769251 1.68080407 -0.44035866 -0.34547383
[79] 1.29827274 -0.77131218 -0.61720238 -0.67788872 -0.50676449 0.85960412
[85] -0.46121220 -0.32868127 -0.02106217 -0.52469615 -1.47974667 0.48670247
[91] 0.30900490 -0.01794023 -0.03010401 -0.32582260 1.50983045 0.36677173
[97] -0.94582952 0.22371815 -1.35385693 -0.27861349
>
> colMeans(tmp2)
[1] -0.1262115
> colSums(tmp2)
[1] -12.62115
> colVars(tmp2)
[1] 0.7176159
> colSd(tmp2)
[1] 0.8471221
> colMax(tmp2)
[1] 2.585726
> colMin(tmp2)
[1] -2.430283
> colMedians(tmp2)
[1] -0.2208348
> colRanges(tmp2)
[,1]
[1,] -2.430283
[2,] 2.585726
>
> 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.3270542 -5.1413521 1.7867789 -0.1246876 -0.3846304 3.0389011
[7] 4.3621105 -1.1053729 -7.1558243 0.2187384
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.65689514
[2,] -0.51084772
[3,] -0.08179719
[4,] 0.69484812
[5,] 0.86719285
>
> rowApply(tmp,sum)
[1] -0.5830489 -1.1425044 -1.9225960 2.4439441 5.5683411 1.9674200
[7] -1.8175645 -3.3522432 -4.1545274 -1.8396135
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 6 6 4 1 6 7 9 9 2 5
[2,] 9 10 1 6 4 2 4 4 5 1
[3,] 2 9 3 8 1 9 7 6 10 4
[4,] 3 1 9 5 10 5 5 5 3 6
[5,] 8 5 2 4 7 4 6 8 4 8
[6,] 10 3 5 10 2 1 10 7 9 9
[7,] 5 2 7 9 8 10 3 10 6 10
[8,] 4 4 8 2 5 8 8 2 7 3
[9,] 1 8 6 7 9 3 2 3 1 2
[10,] 7 7 10 3 3 6 1 1 8 7
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.311753708 -4.333133506 -0.193766762 -0.435974243 -0.715582687
[6] 4.060671078 -0.531957464 -1.909238428 0.565436834 -0.748645109
[11] -0.861716195 2.717534108 -1.381585105 -2.657247415 4.300826370
[16] -2.027055737 2.140582240 -0.008085392 -0.651486772 -1.026336487
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.4072824
[2,] -0.5631689
[3,] 0.3571976
[4,] 0.7568219
[5,] 1.1681855
>
> rowApply(tmp,sum)
[1] -2.2572746 4.0057260 0.9072381 -6.8745258 0.8338294
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 2 2 19 15 13
[2,] 13 1 1 19 2
[3,] 5 5 17 8 15
[4,] 11 4 3 11 17
[5,] 3 9 9 13 7
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -1.4072824 0.2493135 -0.7602833 0.1275383 -0.9953195 0.5737919
[2,] -0.5631689 -2.7678654 -0.3098972 -0.4051155 0.1838583 0.9540743
[3,] 1.1681855 -1.5608027 0.9443960 -0.9150152 0.1297454 0.2198724
[4,] 0.7568219 1.0580669 -0.6925175 -0.1597292 0.4637544 0.8616904
[5,] 0.3571976 -1.3118458 0.6245353 0.9163473 -0.4976212 1.4512421
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.4558034 -0.01239682 -1.7590566 0.8607997 0.4174246 -0.8487797
[2,] 0.2730016 -0.09368094 1.2697839 1.6492682 0.3606738 0.3261037
[3,] 0.2642445 1.51190223 0.4588558 -0.7746662 0.2089366 0.7870415
[4,] -0.5740516 -2.49737192 0.3294979 -1.8054666 -1.6265991 0.9170060
[5,] -0.9509554 -0.81769099 0.2663558 -0.6785802 -0.2221521 1.5361626
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.3947668 0.04631331 0.5668696 0.6526808 0.1876025 0.48027019
[2,] 0.5406221 -0.24040349 2.1373642 0.3473121 -0.4707004 -0.08578476
[3,] 0.2437159 -1.42542127 -0.5256623 -0.6341971 1.0703072 -0.42447789
[4,] -0.2363764 -2.65061271 1.7943696 -1.1615704 0.9713106 0.48031267
[5,] -1.5347799 1.61287675 0.3278853 -1.2312811 0.3820623 -0.45840560
[,19] [,20]
[1,] -0.4527349 -0.2450621
[2,] 0.6763019 0.2239784
[3,] -0.3312258 0.4915033
[4,] -0.8876763 -2.2153844
[5,] 0.3438484 0.7186282
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 649 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 561 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.9524966 2.354533 -0.5966017 -0.6844931 0.3663167 0.8655113 -0.6303836
col8 col9 col10 col11 col12 col13 col14
row1 0.1323559 -0.811748 0.01917195 -0.5932799 -1.598263 0.9581417 1.726677
col15 col16 col17 col18 col19 col20
row1 -0.08190864 1.858407 0.3673549 -1.038262 1.147848 1.28013
> tmp[,"col10"]
col10
row1 0.01917195
row2 0.53412686
row3 0.62718824
row4 0.02601851
row5 0.57425336
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 0.9524966 2.3545328 -0.5966017 -0.6844931 0.3663167 0.8655113
row5 0.1806628 -0.5016617 -1.9334720 -0.3046881 1.5680160 -1.4375239
col7 col8 col9 col10 col11 col12
row1 -0.630383591 0.1323559 -0.8117480 0.01917195 -0.59327987 -1.5982634
row5 0.002580298 0.1112544 0.4802835 0.57425336 -0.03998636 0.8462266
col13 col14 col15 col16 col17 col18 col19
row1 0.9581417 1.7266774 -0.08190864 1.858407 0.3673549 -1.0382620 1.1478484
row5 2.3350037 0.2897089 0.64860247 1.045279 -0.2624507 0.2493451 0.8996008
col20
row1 1.2801297
row5 -0.3553657
> tmp[,c("col6","col20")]
col6 col20
row1 0.8655113 1.2801297
row2 0.8263195 1.0059273
row3 -0.8531428 0.3510912
row4 1.3286668 -0.4256662
row5 -1.4375239 -0.3553657
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.8655113 1.2801297
row5 -1.4375239 -0.3553657
>
>
>
>
> 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.19731 49.48106 48.47476 49.60468 50.93817 106.3773 49.65438 50.49017
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.45697 50.51166 48.34516 49.44438 51.01314 51.26108 51.70908 50.6821
col17 col18 col19 col20
row1 50.09469 50.0322 48.49024 107.3527
> tmp[,"col10"]
col10
row1 50.51166
row2 29.25722
row3 31.57684
row4 29.63433
row5 51.34223
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 51.19731 49.48106 48.47476 49.60468 50.93817 106.3773 49.65438 50.49017
row5 50.01066 51.92563 50.61478 48.98386 50.62354 105.4618 49.75440 50.15453
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.45697 50.51166 48.34516 49.44438 51.01314 51.26108 51.70908 50.68210
row5 48.32894 51.34223 50.19373 49.98252 49.79442 50.13641 51.26854 50.80496
col17 col18 col19 col20
row1 50.09469 50.03220 48.49024 107.3527
row5 50.87226 50.15728 49.10571 102.4396
> tmp[,c("col6","col20")]
col6 col20
row1 106.37728 107.35266
row2 76.69336 75.13849
row3 74.55176 75.78547
row4 75.46218 74.20743
row5 105.46184 102.43958
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 106.3773 107.3527
row5 105.4618 102.4396
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 106.3773 107.3527
row5 105.4618 102.4396
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.30410873
[2,] 0.09926168
[3,] 0.08674541
[4,] -0.32582688
[5,] 1.13970275
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.402557 1.4025484
[2,] -1.889569 0.7918462
[3,] -1.417124 -1.3021935
[4,] -1.240618 -1.7072413
[5,] -0.646380 -0.8086136
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.2013286 -0.820842365
[2,] 0.2957847 0.269385579
[3,] -1.3491035 0.557269862
[4,] 1.9432838 -0.725129891
[5,] -0.9092212 0.008406881
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.2013286
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.2013286
[2,] 0.2957847
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row3 0.7700135 -0.9018162 0.1129367 0.5246728 0.4579720 0.9836735
row1 -1.1031808 0.8324796 -0.1388911 -0.4630840 0.6951174 -0.7191245
[,7] [,8] [,9] [,10] [,11] [,12]
row3 0.5348100 -0.6276562 1.5280990 -0.7247414 -1.3340219 -0.09889066
row1 -0.7303406 -0.9628189 -0.5619066 2.2759883 0.3877305 -0.19947192
[,13] [,14] [,15] [,16] [,17] [,18]
row3 -0.51806371 -0.1133175 -0.15762461 -0.04886387 -0.6577715 0.1802669
row1 0.05691091 -2.8502140 0.05498807 -1.06444041 -0.6267734 -0.6593543
[,19] [,20]
row3 -0.1504696 -1.542319
row1 -0.7659267 2.155572
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.1462006 -0.7345084 0.9033938 1.248258 -1.457148 -1.43937 0.7157811
[,8] [,9] [,10]
row2 -0.7834083 -0.652693 -0.03245555
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -1.350233 0.4982582 0.1634914 -0.3929543 -0.09526947 -0.5797241 -0.6052024
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.406221 1.502802 0.1634317 0.6723075 -0.2426857 -1.212004 -1.000433
[,15] [,16] [,17] [,18] [,19] [,20]
row5 1.159273 1.175807 -1.327689 1.375835 -0.1855706 -0.5005296
>
>
> 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: 0x65513ef7aea0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM482664324b0b8"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM4826628dd885"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM4826614d9d5a"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM48266620a4729"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM482667abda6cd"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM48266458e8711"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM4826610e7b06c"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM48266ccfa556"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM482667fdbd7c"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM482664e963768"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM4826686a4c23"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM4826677b1ae64"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM482664d04078a"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM482663faacd17"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM4826613e12f72"
>
>
> ### 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: 0x65513ed004d0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x65513ed004d0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x65513ed004d0>
> rowMedians(tmp)
[1] 0.193435187 -0.045035766 -0.218760349 -0.167609604 0.070483173
[6] 0.160378295 -0.512300385 -0.130320331 0.071700470 0.062701324
[11] -0.095275294 -0.150439384 -0.294611832 0.781984133 0.086502814
[16] -0.128947772 -0.248955916 0.078518843 -0.386056472 0.127798147
[21] 0.259533344 -0.263207312 0.065275780 0.456511176 -0.015854438
[26] -0.389374017 -0.376896669 -0.261465291 0.025083344 -0.003353163
[31] -0.269534705 0.133557966 -0.094270872 0.258839503 -0.275035922
[36] -0.114723234 0.344956651 0.055470821 -0.185401062 0.143866580
[41] -0.101044128 0.239106339 -0.441256591 -0.038648827 -0.273836715
[46] -0.211824560 -0.085537487 0.063257523 -0.404956652 0.235713053
[51] 0.146237744 -0.155691825 -0.042103886 0.120756803 -0.339526903
[56] -0.121149942 -0.422015469 -0.264802153 0.377124968 -0.073063800
[61] 0.133834513 0.102881637 -0.360842721 -0.037264011 0.261455995
[66] -0.115174034 0.792883952 0.376683815 0.560839941 -0.134754973
[71] 0.117290493 -0.404712459 -0.011499438 0.299320191 -0.583108144
[76] 0.382788773 0.142042211 0.635376614 0.019862282 -0.594766040
[81] 0.015262416 -0.101041187 0.052501981 0.151916354 0.349004635
[86] 0.163967515 0.028275729 -0.033120488 -0.455554464 0.212825276
[91] 0.145495665 -0.418154693 0.633963237 0.245327667 0.212577293
[96] 0.296187155 -0.113532014 -0.324186427 0.017293581 0.672426818
[101] 0.446260925 0.227211287 -0.242429810 -0.357951604 -0.392366541
[106] 0.044194677 -0.142614316 -0.265793243 0.070249356 0.695395633
[111] 0.093505803 0.220879821 -0.212562768 -0.275108619 -0.440892511
[116] -0.296200791 0.064962934 -0.368612737 0.321126883 0.033502890
[121] 0.305258601 -0.148311657 -0.077239622 0.409511274 -0.595327511
[126] 0.024753793 -0.124047317 0.143046413 -0.217444350 0.252776679
[131] -0.307035877 -0.318842498 -0.071781538 -0.307781975 0.330082902
[136] -0.208154812 0.531718037 0.106310095 0.230405829 -0.060736003
[141] -0.162678958 0.216888792 0.143848634 0.158065095 -0.512011957
[146] 0.045371674 0.289991765 0.332450854 -0.331992579 -0.111738157
[151] -0.506360365 -0.450524623 -0.170580579 0.042740778 -0.211038567
[156] -0.030969538 0.728444669 0.261490548 -0.149745253 0.035502164
[161] 0.212381611 -0.008079527 -0.072290900 -0.640175979 -0.464940906
[166] 0.432909558 0.006410891 0.183466799 -0.536189051 0.016337099
[171] -0.046693304 0.366178457 0.210090037 0.203019898 -0.228581812
[176] 0.278773615 0.115189603 -0.157947474 -0.003758869 0.176078811
[181] -0.077543111 -0.004420341 -0.745762080 0.122251686 0.112715462
[186] 0.403367342 -0.467762422 0.227420722 -0.012818897 -0.058953482
[191] -0.405132118 0.018309615 0.088034788 -0.638913244 -0.304806322
[196] 0.038260084 0.331959282 -0.422018782 0.346102116 0.198298221
[201] 0.167605924 0.608757789 -0.019793077 0.280593832 0.679702609
[206] 0.121252055 -0.351155845 -0.045418826 0.239775693 -0.164178485
[211] 0.094624605 0.061210303 -0.105868242 0.064721032 0.534891159
[216] 0.368981919 0.099144318 0.545904522 -0.179122311 0.411892046
[221] 0.387178197 0.059942582 0.065015599 -0.249877374 0.066649232
[226] -0.310572680 -0.265414240 -0.782687607 0.305409911 -0.521324202
>
> proc.time()
user system elapsed
1.301 1.445 2.736
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> prefix <- "dbmtest"
> directory <- getwd()
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x62c4688cdc10>
> .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: 0x62c4688cdc10>
> .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: 0x62c4688cdc10>
> .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: 0x62c4688cdc10>
> 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: 0x62c4695902d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62c4695902d0>
> .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: 0x62c4695902d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62c4695902d0>
> .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: 0x62c4695902d0>
> 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: 0x62c469c65d70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62c469c65d70>
> .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: 0x62c469c65d70>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x62c469c65d70>
> .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: 0x62c469c65d70>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x62c469c65d70>
> .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: 0x62c469c65d70>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x62c469c65d70>
> .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: 0x62c469c65d70>
> 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: 0x62c4697d9370>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x62c4697d9370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62c4697d9370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62c4697d9370>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile482b22df3a661" "BufferedMatrixFile482b2e1ceb4e"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile482b22df3a661" "BufferedMatrixFile482b2e1ceb4e"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x62c469724ff0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62c469724ff0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x62c469724ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x62c469724ff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x62c469724ff0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x62c469724ff0>
> .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: 0x62c4699073d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x62c4699073d0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x62c4699073d0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x62c4699073d0>
> 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: 0x62c46b0b8fb0>
> .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: 0x62c46b0b8fb0>
> rm(P)
>
> proc.time()
user system elapsed
0.245 0.055 0.286
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100 0
> buffer.dim(Temp)
[1] 1 1
>
>
> proc.time()
user system elapsed
0.243 0.046 0.278