| Back to Build/check report for BioC 3.22: simplified long |
|
This page was generated on 2026-02-16 11:57 -0500 (Mon, 16 Feb 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble" | 4889 |
| Click on any hostname to see more info about the system (e.g. compilers) (*) as reported by 'uname -p', except on Windows and Mac OS X | ||||
| Package 257/2361 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.74.0 (landing page) Ben Bolstad
| nebbiolo2 | 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.74.0 |
| Command: /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz |
| StartedAt: 2026-02-12 22:09:34 -0500 (Thu, 12 Feb 2026) |
| EndedAt: 2026-02-12 22:09:58 -0500 (Thu, 12 Feb 2026) |
| EllapsedTime: 24.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.22-bioc/R/site-library --timings BufferedMatrix_1.74.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.2 (2025-10-31)
* 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.74.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 ... NOTE
Note: information on .o files is not available
* 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: 2 NOTEs
See
‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.22-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.22-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.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.22-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.22-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.22-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.22-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.22-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.22-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.22-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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.231 0.053 0.274
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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.22-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 478284 25.6 1046725 56 639600 34.2
Vcells 884773 6.8 8388608 64 2081613 15.9
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Thu Feb 12 22:09:49 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Thu Feb 12 22:09:49 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: 0x643058575370>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Thu Feb 12 22:09:50 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Thu Feb 12 22:09:50 2026"
>
> ColMode(tmp2)
<pointer: 0x643058575370>
>
>
>
> ### 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,] 101.0658555 -0.7890858 0.2582345 -1.0663061
[2,] 0.2839141 0.4484916 -1.6201915 -0.8681838
[3,] -0.5026987 -0.4605359 -0.1933585 1.3610938
[4,] 1.4346684 1.1089870 1.6345823 -1.5392135
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-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,] 101.0658555 0.7890858 0.2582345 1.0663061
[2,] 0.2839141 0.4484916 1.6201915 0.8681838
[3,] 0.5026987 0.4605359 0.1933585 1.3610938
[4,] 1.4346684 1.1089870 1.6345823 1.5392135
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-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.0531515 0.8883050 0.5081678 1.0326210
[2,] 0.5328359 0.6696952 1.2728674 0.9317638
[3,] 0.7090125 0.6786280 0.4397255 1.1666592
[4,] 1.1977764 1.0530845 1.2785078 1.2406504
>
> 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.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 226.59737 34.67214 30.33991 36.39252
[2,] 30.61227 32.14544 39.34887 35.18582
[3,] 32.59282 32.24682 29.59061 38.02769
[4,] 38.41243 36.63983 39.41966 38.94572
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6430595719b0>
> exp(tmp5)
<pointer: 0x6430595719b0>
> log(tmp5,2)
<pointer: 0x6430595719b0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.6327
> Min(tmp5)
[1] 55.74386
> mean(tmp5)
[1] 73.51659
> Sum(tmp5)
[1] 14703.32
> Var(tmp5)
[1] 856.653
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 88.39744 69.03349 70.17123 71.86728 73.93728 73.02219 74.40720 72.09206
[9] 69.54394 72.69385
> rowSums(tmp5)
[1] 1767.949 1380.670 1403.425 1437.346 1478.746 1460.444 1488.144 1441.841
[9] 1390.879 1453.877
> rowVars(tmp5)
[1] 8186.46376 47.83060 59.99051 47.64761 47.25359 49.14386
[7] 47.81869 33.76333 111.00183 51.76537
> rowSd(tmp5)
[1] 90.479079 6.915967 7.745354 6.902725 6.874125 7.010268 6.915106
[8] 5.810622 10.535741 7.194815
> rowMax(tmp5)
[1] 471.63274 83.40692 86.17035 82.18421 83.13818 85.09509 84.69582
[8] 81.28830 92.80000 82.83302
> rowMin(tmp5)
[1] 58.27982 57.49770 58.35905 61.08474 59.97553 58.88239 59.23061 57.57555
[9] 55.74386 56.73503
>
> colMeans(tmp5)
[1] 114.88064 72.17548 71.92643 75.85516 69.57696 69.21012 72.52538
[8] 73.69083 71.42168 70.13963 69.27205 68.80884 67.78865 73.23190
[15] 75.90585 71.22822 73.83871 71.94567 69.32028 67.58939
> colSums(tmp5)
[1] 1148.8064 721.7548 719.2643 758.5516 695.7696 692.1012 725.2538
[8] 736.9083 714.2168 701.3963 692.7205 688.0884 677.8865 732.3190
[15] 759.0585 712.2822 738.3871 719.4567 693.2028 675.8939
> colVars(tmp5)
[1] 15759.21484 19.49061 89.48963 19.30742 62.17103 52.18837
[7] 51.47656 64.35724 94.89291 64.75930 25.78059 63.20919
[13] 85.51280 50.04169 52.00217 28.59229 40.46998 102.70346
[19] 34.20668 58.37291
> colSd(tmp5)
[1] 125.535711 4.414817 9.459896 4.394021 7.884861 7.224152
[7] 7.174716 8.022296 9.741299 8.047316 5.077459 7.950421
[13] 9.247313 7.074015 7.211253 5.347176 6.361602 10.134272
[19] 5.848648 7.640216
> colMax(tmp5)
[1] 471.63274 78.87165 82.04686 81.06041 83.41379 81.01181 81.34507
[8] 85.09509 86.17035 82.33597 75.01826 83.13818 84.69582 82.83302
[15] 82.70822 77.14653 83.40692 92.80000 82.17704 79.57093
> colMin(tmp5)
[1] 63.71543 66.90653 56.51429 68.40849 58.88519 57.83486 59.97553 60.98312
[9] 56.87005 55.74386 59.27589 56.73503 57.96122 62.85428 63.64505 62.21277
[17] 64.43586 58.27982 61.13896 57.49770
>
>
> ### 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] NA 69.03349 70.17123 71.86728 73.93728 73.02219 74.40720 72.09206
[9] 69.54394 72.69385
> rowSums(tmp5)
[1] NA 1380.670 1403.425 1437.346 1478.746 1460.444 1488.144 1441.841
[9] 1390.879 1453.877
> rowVars(tmp5)
[1] 8625.85938 47.83060 59.99051 47.64761 47.25359 49.14386
[7] 47.81869 33.76333 111.00183 51.76537
> rowSd(tmp5)
[1] 92.875505 6.915967 7.745354 6.902725 6.874125 7.010268 6.915106
[8] 5.810622 10.535741 7.194815
> rowMax(tmp5)
[1] NA 83.40692 86.17035 82.18421 83.13818 85.09509 84.69582 81.28830
[9] 92.80000 82.83302
> rowMin(tmp5)
[1] NA 57.49770 58.35905 61.08474 59.97553 58.88239 59.23061 57.57555
[9] 55.74386 56.73503
>
> colMeans(tmp5)
[1] 114.88064 NA 71.92643 75.85516 69.57696 69.21012 72.52538
[8] 73.69083 71.42168 70.13963 69.27205 68.80884 67.78865 73.23190
[15] 75.90585 71.22822 73.83871 71.94567 69.32028 67.58939
> colSums(tmp5)
[1] 1148.8064 NA 719.2643 758.5516 695.7696 692.1012 725.2538
[8] 736.9083 714.2168 701.3963 692.7205 688.0884 677.8865 732.3190
[15] 759.0585 712.2822 738.3871 719.4567 693.2028 675.8939
> colVars(tmp5)
[1] 15759.21484 NA 89.48963 19.30742 62.17103 52.18837
[7] 51.47656 64.35724 94.89291 64.75930 25.78059 63.20919
[13] 85.51280 50.04169 52.00217 28.59229 40.46998 102.70346
[19] 34.20668 58.37291
> colSd(tmp5)
[1] 125.535711 NA 9.459896 4.394021 7.884861 7.224152
[7] 7.174716 8.022296 9.741299 8.047316 5.077459 7.950421
[13] 9.247313 7.074015 7.211253 5.347176 6.361602 10.134272
[19] 5.848648 7.640216
> colMax(tmp5)
[1] 471.63274 NA 82.04686 81.06041 83.41379 81.01181 81.34507
[8] 85.09509 86.17035 82.33597 75.01826 83.13818 84.69582 82.83302
[15] 82.70822 77.14653 83.40692 92.80000 82.17704 79.57093
> colMin(tmp5)
[1] 63.71543 NA 56.51429 68.40849 58.88519 57.83486 59.97553 60.98312
[9] 56.87005 55.74386 59.27589 56.73503 57.96122 62.85428 63.64505 62.21277
[17] 64.43586 58.27982 61.13896 57.49770
>
> Max(tmp5,na.rm=TRUE)
[1] 471.6327
> Min(tmp5,na.rm=TRUE)
[1] 55.74386
> mean(tmp5,na.rm=TRUE)
[1] 73.52338
> Sum(tmp5,na.rm=TRUE)
[1] 14631.15
> Var(tmp5,na.rm=TRUE)
[1] 860.9703
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.25175 69.03349 70.17123 71.86728 73.93728 73.02219 74.40720 72.09206
[9] 69.54394 72.69385
> rowSums(tmp5,na.rm=TRUE)
[1] 1695.783 1380.670 1403.425 1437.346 1478.746 1460.444 1488.144 1441.841
[9] 1390.879 1453.877
> rowVars(tmp5,na.rm=TRUE)
[1] 8625.85938 47.83060 59.99051 47.64761 47.25359 49.14386
[7] 47.81869 33.76333 111.00183 51.76537
> rowSd(tmp5,na.rm=TRUE)
[1] 92.875505 6.915967 7.745354 6.902725 6.874125 7.010268 6.915106
[8] 5.810622 10.535741 7.194815
> rowMax(tmp5,na.rm=TRUE)
[1] 471.63274 83.40692 86.17035 82.18421 83.13818 85.09509 84.69582
[8] 81.28830 92.80000 82.83302
> rowMin(tmp5,na.rm=TRUE)
[1] 58.27982 57.49770 58.35905 61.08474 59.97553 58.88239 59.23061 57.57555
[9] 55.74386 56.73503
>
> colMeans(tmp5,na.rm=TRUE)
[1] 114.88064 72.17659 71.92643 75.85516 69.57696 69.21012 72.52538
[8] 73.69083 71.42168 70.13963 69.27205 68.80884 67.78865 73.23190
[15] 75.90585 71.22822 73.83871 71.94567 69.32028 67.58939
> colSums(tmp5,na.rm=TRUE)
[1] 1148.8064 649.5893 719.2643 758.5516 695.7696 692.1012 725.2538
[8] 736.9083 714.2168 701.3963 692.7205 688.0884 677.8865 732.3190
[15] 759.0585 712.2822 738.3871 719.4567 693.2028 675.8939
> colVars(tmp5,na.rm=TRUE)
[1] 15759.21484 21.92692 89.48963 19.30742 62.17103 52.18837
[7] 51.47656 64.35724 94.89291 64.75930 25.78059 63.20919
[13] 85.51280 50.04169 52.00217 28.59229 40.46998 102.70346
[19] 34.20668 58.37291
> colSd(tmp5,na.rm=TRUE)
[1] 125.535711 4.682619 9.459896 4.394021 7.884861 7.224152
[7] 7.174716 8.022296 9.741299 8.047316 5.077459 7.950421
[13] 9.247313 7.074015 7.211253 5.347176 6.361602 10.134272
[19] 5.848648 7.640216
> colMax(tmp5,na.rm=TRUE)
[1] 471.63274 78.87165 82.04686 81.06041 83.41379 81.01181 81.34507
[8] 85.09509 86.17035 82.33597 75.01826 83.13818 84.69582 82.83302
[15] 82.70822 77.14653 83.40692 92.80000 82.17704 79.57093
> colMin(tmp5,na.rm=TRUE)
[1] 63.71543 66.90653 56.51429 68.40849 58.88519 57.83486 59.97553 60.98312
[9] 56.87005 55.74386 59.27589 56.73503 57.96122 62.85428 63.64505 62.21277
[17] 64.43586 58.27982 61.13896 57.49770
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] NaN 69.03349 70.17123 71.86728 73.93728 73.02219 74.40720 72.09206
[9] 69.54394 72.69385
> rowSums(tmp5,na.rm=TRUE)
[1] 0.000 1380.670 1403.425 1437.346 1478.746 1460.444 1488.144 1441.841
[9] 1390.879 1453.877
> rowVars(tmp5,na.rm=TRUE)
[1] NA 47.83060 59.99051 47.64761 47.25359 49.14386 47.81869
[8] 33.76333 111.00183 51.76537
> rowSd(tmp5,na.rm=TRUE)
[1] NA 6.915967 7.745354 6.902725 6.874125 7.010268 6.915106
[8] 5.810622 10.535741 7.194815
> rowMax(tmp5,na.rm=TRUE)
[1] NA 83.40692 86.17035 82.18421 83.13818 85.09509 84.69582 81.28830
[9] 92.80000 82.83302
> rowMin(tmp5,na.rm=TRUE)
[1] NA 57.49770 58.35905 61.08474 59.97553 58.88239 59.23061 57.57555
[9] 55.74386 56.73503
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 75.24151 NaN 72.90175 75.86726 70.76493 68.70348 72.01468 75.10280
[9] 71.05892 71.22430 70.38273 69.14683 68.24916 72.89812 75.18951 71.90860
[17] 74.28095 73.46410 69.08934 67.59777
> colSums(tmp5,na.rm=TRUE)
[1] 677.1736 0.0000 656.1158 682.8053 636.8844 618.3313 648.1321 675.9252
[9] 639.5303 641.0187 633.4446 622.3215 614.2425 656.0831 676.7056 647.1774
[17] 668.5285 661.1769 621.8041 608.3800
> colVars(tmp5,na.rm=TRUE)
[1] 52.44139 NA 89.97428 21.71920 54.06548 55.82419 54.97700
[8] 49.97331 105.27411 59.61845 15.12494 69.82520 93.81611 55.04353
[15] 52.72944 26.95859 43.32856 89.60311 37.88256 65.66873
> colSd(tmp5,na.rm=TRUE)
[1] 7.241643 NA 9.485477 4.660386 7.352923 7.471559 7.414648
[8] 7.069180 10.260317 7.721298 3.889080 8.356148 9.685872 7.419133
[15] 7.261504 5.192166 6.582443 9.465892 6.154881 8.103625
> colMax(tmp5,na.rm=TRUE)
[1] 84.21654 -Inf 82.04686 81.06041 83.41379 81.01181 81.34507 85.09509
[9] 86.17035 82.33597 75.01826 83.13818 84.69582 82.83302 82.70822 77.14653
[17] 83.40692 92.80000 82.17704 79.57093
> colMin(tmp5,na.rm=TRUE)
[1] 63.71543 Inf 56.51429 68.40849 62.03404 57.83486 59.97553 63.13240
[9] 56.87005 55.74386 62.69046 56.73503 57.96122 62.85428 63.64505 62.21277
[17] 64.43586 59.23061 61.13896 57.49770
>
>
>
>
> 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] 136.7397 215.0143 215.1261 123.3947 287.4061 268.3930 183.4781 250.3091
[9] 219.7824 203.4073
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 136.7397 215.0143 215.1261 123.3947 287.4061 268.3930 183.4781 250.3091
[9] 219.7824 203.4073
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] 2.842171e-14 -1.705303e-13 0.000000e+00 -1.705303e-13 -2.842171e-14
[6] 1.136868e-13 0.000000e+00 0.000000e+00 8.526513e-14 2.842171e-14
[11] 1.136868e-13 5.684342e-14 0.000000e+00 1.136868e-13 1.705303e-13
[16] -5.684342e-14 -8.526513e-14 -2.273737e-13 -2.842171e-13 7.105427e-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)
+ }
8 6
1 9
4 6
3 2
10 1
7 12
6 2
1 15
2 16
3 16
2 12
7 1
4 17
8 19
4 8
3 19
8 17
5 4
7 3
10 10
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] 3.07924
> Min(tmp)
[1] -2.671073
> mean(tmp)
[1] 0.07903569
> Sum(tmp)
[1] 7.903569
> Var(tmp)
[1] 1.302397
>
> rowMeans(tmp)
[1] 0.07903569
> rowSums(tmp)
[1] 7.903569
> rowVars(tmp)
[1] 1.302397
> rowSd(tmp)
[1] 1.141226
> rowMax(tmp)
[1] 3.07924
> rowMin(tmp)
[1] -2.671073
>
> colMeans(tmp)
[1] -0.175404999 0.672861478 -0.587813062 -0.673572725 -0.815417558
[6] -1.456316876 0.429316917 1.102422859 2.342654305 1.540969441
[11] -0.473574157 1.485860271 3.079240326 -1.242529762 -0.696998737
[16] 2.189600855 0.129732982 0.004533264 0.245045501 1.826120224
[21] 0.929995177 -0.286465633 -1.565333657 2.091030957 0.135814211
[26] -0.658750290 1.283626333 2.084999588 -1.069969986 0.253944496
[31] -1.457825938 -1.356034043 0.063317133 0.188699299 0.149609951
[36] 1.488717592 0.904415710 0.833707861 -0.107095189 -0.638269706
[41] 0.190383515 2.203667182 0.094901504 0.170309126 -1.244355480
[46] -1.367308392 -1.867709025 -0.808503056 0.756341695 -1.762721404
[51] -0.839157915 0.222308546 0.239261165 -0.597969337 -0.392789267
[56] 0.549573395 1.095264206 0.685749272 2.248785501 -0.259426059
[61] 0.225069978 -0.507603570 0.055844100 -2.671073314 -1.074759731
[66] -1.340367349 -0.207764207 0.140929716 -1.311581821 1.011049397
[71] -0.430241887 -2.408560768 0.374329254 -0.730727353 -0.234020667
[76] 0.933023201 1.586944440 -2.146179742 0.742108223 1.344067025
[81] 0.001144333 -0.679967411 -0.299284082 1.008863305 1.342715718
[86] -1.790415716 -0.591098979 1.040855495 -0.198315976 0.985860085
[91] -1.031520663 -0.416125136 0.408191332 1.765934166 0.518816798
[96] -0.599965262 0.305360029 0.376397749 1.084907606 -0.190739295
> colSums(tmp)
[1] -0.175404999 0.672861478 -0.587813062 -0.673572725 -0.815417558
[6] -1.456316876 0.429316917 1.102422859 2.342654305 1.540969441
[11] -0.473574157 1.485860271 3.079240326 -1.242529762 -0.696998737
[16] 2.189600855 0.129732982 0.004533264 0.245045501 1.826120224
[21] 0.929995177 -0.286465633 -1.565333657 2.091030957 0.135814211
[26] -0.658750290 1.283626333 2.084999588 -1.069969986 0.253944496
[31] -1.457825938 -1.356034043 0.063317133 0.188699299 0.149609951
[36] 1.488717592 0.904415710 0.833707861 -0.107095189 -0.638269706
[41] 0.190383515 2.203667182 0.094901504 0.170309126 -1.244355480
[46] -1.367308392 -1.867709025 -0.808503056 0.756341695 -1.762721404
[51] -0.839157915 0.222308546 0.239261165 -0.597969337 -0.392789267
[56] 0.549573395 1.095264206 0.685749272 2.248785501 -0.259426059
[61] 0.225069978 -0.507603570 0.055844100 -2.671073314 -1.074759731
[66] -1.340367349 -0.207764207 0.140929716 -1.311581821 1.011049397
[71] -0.430241887 -2.408560768 0.374329254 -0.730727353 -0.234020667
[76] 0.933023201 1.586944440 -2.146179742 0.742108223 1.344067025
[81] 0.001144333 -0.679967411 -0.299284082 1.008863305 1.342715718
[86] -1.790415716 -0.591098979 1.040855495 -0.198315976 0.985860085
[91] -1.031520663 -0.416125136 0.408191332 1.765934166 0.518816798
[96] -0.599965262 0.305360029 0.376397749 1.084907606 -0.190739295
> 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.175404999 0.672861478 -0.587813062 -0.673572725 -0.815417558
[6] -1.456316876 0.429316917 1.102422859 2.342654305 1.540969441
[11] -0.473574157 1.485860271 3.079240326 -1.242529762 -0.696998737
[16] 2.189600855 0.129732982 0.004533264 0.245045501 1.826120224
[21] 0.929995177 -0.286465633 -1.565333657 2.091030957 0.135814211
[26] -0.658750290 1.283626333 2.084999588 -1.069969986 0.253944496
[31] -1.457825938 -1.356034043 0.063317133 0.188699299 0.149609951
[36] 1.488717592 0.904415710 0.833707861 -0.107095189 -0.638269706
[41] 0.190383515 2.203667182 0.094901504 0.170309126 -1.244355480
[46] -1.367308392 -1.867709025 -0.808503056 0.756341695 -1.762721404
[51] -0.839157915 0.222308546 0.239261165 -0.597969337 -0.392789267
[56] 0.549573395 1.095264206 0.685749272 2.248785501 -0.259426059
[61] 0.225069978 -0.507603570 0.055844100 -2.671073314 -1.074759731
[66] -1.340367349 -0.207764207 0.140929716 -1.311581821 1.011049397
[71] -0.430241887 -2.408560768 0.374329254 -0.730727353 -0.234020667
[76] 0.933023201 1.586944440 -2.146179742 0.742108223 1.344067025
[81] 0.001144333 -0.679967411 -0.299284082 1.008863305 1.342715718
[86] -1.790415716 -0.591098979 1.040855495 -0.198315976 0.985860085
[91] -1.031520663 -0.416125136 0.408191332 1.765934166 0.518816798
[96] -0.599965262 0.305360029 0.376397749 1.084907606 -0.190739295
> colMin(tmp)
[1] -0.175404999 0.672861478 -0.587813062 -0.673572725 -0.815417558
[6] -1.456316876 0.429316917 1.102422859 2.342654305 1.540969441
[11] -0.473574157 1.485860271 3.079240326 -1.242529762 -0.696998737
[16] 2.189600855 0.129732982 0.004533264 0.245045501 1.826120224
[21] 0.929995177 -0.286465633 -1.565333657 2.091030957 0.135814211
[26] -0.658750290 1.283626333 2.084999588 -1.069969986 0.253944496
[31] -1.457825938 -1.356034043 0.063317133 0.188699299 0.149609951
[36] 1.488717592 0.904415710 0.833707861 -0.107095189 -0.638269706
[41] 0.190383515 2.203667182 0.094901504 0.170309126 -1.244355480
[46] -1.367308392 -1.867709025 -0.808503056 0.756341695 -1.762721404
[51] -0.839157915 0.222308546 0.239261165 -0.597969337 -0.392789267
[56] 0.549573395 1.095264206 0.685749272 2.248785501 -0.259426059
[61] 0.225069978 -0.507603570 0.055844100 -2.671073314 -1.074759731
[66] -1.340367349 -0.207764207 0.140929716 -1.311581821 1.011049397
[71] -0.430241887 -2.408560768 0.374329254 -0.730727353 -0.234020667
[76] 0.933023201 1.586944440 -2.146179742 0.742108223 1.344067025
[81] 0.001144333 -0.679967411 -0.299284082 1.008863305 1.342715718
[86] -1.790415716 -0.591098979 1.040855495 -0.198315976 0.985860085
[91] -1.031520663 -0.416125136 0.408191332 1.765934166 0.518816798
[96] -0.599965262 0.305360029 0.376397749 1.084907606 -0.190739295
> colMedians(tmp)
[1] -0.175404999 0.672861478 -0.587813062 -0.673572725 -0.815417558
[6] -1.456316876 0.429316917 1.102422859 2.342654305 1.540969441
[11] -0.473574157 1.485860271 3.079240326 -1.242529762 -0.696998737
[16] 2.189600855 0.129732982 0.004533264 0.245045501 1.826120224
[21] 0.929995177 -0.286465633 -1.565333657 2.091030957 0.135814211
[26] -0.658750290 1.283626333 2.084999588 -1.069969986 0.253944496
[31] -1.457825938 -1.356034043 0.063317133 0.188699299 0.149609951
[36] 1.488717592 0.904415710 0.833707861 -0.107095189 -0.638269706
[41] 0.190383515 2.203667182 0.094901504 0.170309126 -1.244355480
[46] -1.367308392 -1.867709025 -0.808503056 0.756341695 -1.762721404
[51] -0.839157915 0.222308546 0.239261165 -0.597969337 -0.392789267
[56] 0.549573395 1.095264206 0.685749272 2.248785501 -0.259426059
[61] 0.225069978 -0.507603570 0.055844100 -2.671073314 -1.074759731
[66] -1.340367349 -0.207764207 0.140929716 -1.311581821 1.011049397
[71] -0.430241887 -2.408560768 0.374329254 -0.730727353 -0.234020667
[76] 0.933023201 1.586944440 -2.146179742 0.742108223 1.344067025
[81] 0.001144333 -0.679967411 -0.299284082 1.008863305 1.342715718
[86] -1.790415716 -0.591098979 1.040855495 -0.198315976 0.985860085
[91] -1.031520663 -0.416125136 0.408191332 1.765934166 0.518816798
[96] -0.599965262 0.305360029 0.376397749 1.084907606 -0.190739295
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.175405 0.6728615 -0.5878131 -0.6735727 -0.8154176 -1.456317 0.4293169
[2,] -0.175405 0.6728615 -0.5878131 -0.6735727 -0.8154176 -1.456317 0.4293169
[,8] [,9] [,10] [,11] [,12] [,13] [,14] [,15]
[1,] 1.102423 2.342654 1.540969 -0.4735742 1.48586 3.07924 -1.24253 -0.6969987
[2,] 1.102423 2.342654 1.540969 -0.4735742 1.48586 3.07924 -1.24253 -0.6969987
[,16] [,17] [,18] [,19] [,20] [,21] [,22]
[1,] 2.189601 0.129733 0.004533264 0.2450455 1.82612 0.9299952 -0.2864656
[2,] 2.189601 0.129733 0.004533264 0.2450455 1.82612 0.9299952 -0.2864656
[,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30]
[1,] -1.565334 2.091031 0.1358142 -0.6587503 1.283626 2.085 -1.06997 0.2539445
[2,] -1.565334 2.091031 0.1358142 -0.6587503 1.283626 2.085 -1.06997 0.2539445
[,31] [,32] [,33] [,34] [,35] [,36] [,37]
[1,] -1.457826 -1.356034 0.06331713 0.1886993 0.14961 1.488718 0.9044157
[2,] -1.457826 -1.356034 0.06331713 0.1886993 0.14961 1.488718 0.9044157
[,38] [,39] [,40] [,41] [,42] [,43] [,44]
[1,] 0.8337079 -0.1070952 -0.6382697 0.1903835 2.203667 0.0949015 0.1703091
[2,] 0.8337079 -0.1070952 -0.6382697 0.1903835 2.203667 0.0949015 0.1703091
[,45] [,46] [,47] [,48] [,49] [,50] [,51]
[1,] -1.244355 -1.367308 -1.867709 -0.8085031 0.7563417 -1.762721 -0.8391579
[2,] -1.244355 -1.367308 -1.867709 -0.8085031 0.7563417 -1.762721 -0.8391579
[,52] [,53] [,54] [,55] [,56] [,57] [,58]
[1,] 0.2223085 0.2392612 -0.5979693 -0.3927893 0.5495734 1.095264 0.6857493
[2,] 0.2223085 0.2392612 -0.5979693 -0.3927893 0.5495734 1.095264 0.6857493
[,59] [,60] [,61] [,62] [,63] [,64] [,65]
[1,] 2.248786 -0.2594261 0.22507 -0.5076036 0.0558441 -2.671073 -1.07476
[2,] 2.248786 -0.2594261 0.22507 -0.5076036 0.0558441 -2.671073 -1.07476
[,66] [,67] [,68] [,69] [,70] [,71] [,72]
[1,] -1.340367 -0.2077642 0.1409297 -1.311582 1.011049 -0.4302419 -2.408561
[2,] -1.340367 -0.2077642 0.1409297 -1.311582 1.011049 -0.4302419 -2.408561
[,73] [,74] [,75] [,76] [,77] [,78] [,79]
[1,] 0.3743293 -0.7307274 -0.2340207 0.9330232 1.586944 -2.14618 0.7421082
[2,] 0.3743293 -0.7307274 -0.2340207 0.9330232 1.586944 -2.14618 0.7421082
[,80] [,81] [,82] [,83] [,84] [,85] [,86]
[1,] 1.344067 0.001144333 -0.6799674 -0.2992841 1.008863 1.342716 -1.790416
[2,] 1.344067 0.001144333 -0.6799674 -0.2992841 1.008863 1.342716 -1.790416
[,87] [,88] [,89] [,90] [,91] [,92] [,93]
[1,] -0.591099 1.040855 -0.198316 0.9858601 -1.031521 -0.4161251 0.4081913
[2,] -0.591099 1.040855 -0.198316 0.9858601 -1.031521 -0.4161251 0.4081913
[,94] [,95] [,96] [,97] [,98] [,99] [,100]
[1,] 1.765934 0.5188168 -0.5999653 0.30536 0.3763977 1.084908 -0.1907393
[2,] 1.765934 0.5188168 -0.5999653 0.30536 0.3763977 1.084908 -0.1907393
>
>
> Max(tmp2)
[1] 2.989001
> Min(tmp2)
[1] -2.560782
> mean(tmp2)
[1] -0.01077983
> Sum(tmp2)
[1] -1.077983
> Var(tmp2)
[1] 1.233805
>
> rowMeans(tmp2)
[1] 0.437950191 -0.352461067 0.135146064 -1.361775091 -1.059915341
[6] 0.986284648 0.417650041 -1.744011453 -0.679421109 -0.323211959
[11] -0.963511466 -1.576980342 -0.176679600 -0.286206328 -0.367318502
[16] -1.309906745 1.452874729 -0.734878152 -0.261115506 -0.701725282
[21] -0.349878926 -0.342438719 0.986866879 1.244643694 -1.213820000
[26] 0.352304040 -0.680910262 -1.379637865 -0.824211697 -0.457813175
[31] 1.290852488 -0.214859619 0.728358774 2.989001442 1.084994570
[36] 1.580047474 1.598788076 1.644745732 -0.520432386 0.937473847
[41] -0.373857248 1.349740385 0.029527591 -0.137910919 -0.181959314
[46] -1.536563248 -0.103273867 0.419223666 -0.659758284 0.534048351
[51] -1.371095052 -1.186240776 -1.652273713 -0.701094427 0.941636368
[56] -2.322203035 0.467272607 0.340501201 -1.273556226 -1.312971192
[61] 1.543070457 -1.160975877 0.701625593 -0.371480015 1.110763009
[66] 1.172396252 0.470645022 2.477479062 -2.560782496 -0.537587331
[71] 0.332810934 0.244749584 -0.602345184 1.359245797 -0.695839895
[76] 0.195074424 -0.009137362 2.275904091 0.470366765 0.970191339
[81] -1.009578989 -0.284240322 0.061315741 -2.208542551 0.380385690
[86] -1.270604996 1.960534728 -1.466678202 -1.385164705 1.611680056
[91] -0.433348538 1.194284832 -1.007620046 1.284235939 0.621070166
[96] 0.246563213 0.921459448 0.402859537 1.120541142 -0.457364326
> rowSums(tmp2)
[1] 0.437950191 -0.352461067 0.135146064 -1.361775091 -1.059915341
[6] 0.986284648 0.417650041 -1.744011453 -0.679421109 -0.323211959
[11] -0.963511466 -1.576980342 -0.176679600 -0.286206328 -0.367318502
[16] -1.309906745 1.452874729 -0.734878152 -0.261115506 -0.701725282
[21] -0.349878926 -0.342438719 0.986866879 1.244643694 -1.213820000
[26] 0.352304040 -0.680910262 -1.379637865 -0.824211697 -0.457813175
[31] 1.290852488 -0.214859619 0.728358774 2.989001442 1.084994570
[36] 1.580047474 1.598788076 1.644745732 -0.520432386 0.937473847
[41] -0.373857248 1.349740385 0.029527591 -0.137910919 -0.181959314
[46] -1.536563248 -0.103273867 0.419223666 -0.659758284 0.534048351
[51] -1.371095052 -1.186240776 -1.652273713 -0.701094427 0.941636368
[56] -2.322203035 0.467272607 0.340501201 -1.273556226 -1.312971192
[61] 1.543070457 -1.160975877 0.701625593 -0.371480015 1.110763009
[66] 1.172396252 0.470645022 2.477479062 -2.560782496 -0.537587331
[71] 0.332810934 0.244749584 -0.602345184 1.359245797 -0.695839895
[76] 0.195074424 -0.009137362 2.275904091 0.470366765 0.970191339
[81] -1.009578989 -0.284240322 0.061315741 -2.208542551 0.380385690
[86] -1.270604996 1.960534728 -1.466678202 -1.385164705 1.611680056
[91] -0.433348538 1.194284832 -1.007620046 1.284235939 0.621070166
[96] 0.246563213 0.921459448 0.402859537 1.120541142 -0.457364326
> 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.437950191 -0.352461067 0.135146064 -1.361775091 -1.059915341
[6] 0.986284648 0.417650041 -1.744011453 -0.679421109 -0.323211959
[11] -0.963511466 -1.576980342 -0.176679600 -0.286206328 -0.367318502
[16] -1.309906745 1.452874729 -0.734878152 -0.261115506 -0.701725282
[21] -0.349878926 -0.342438719 0.986866879 1.244643694 -1.213820000
[26] 0.352304040 -0.680910262 -1.379637865 -0.824211697 -0.457813175
[31] 1.290852488 -0.214859619 0.728358774 2.989001442 1.084994570
[36] 1.580047474 1.598788076 1.644745732 -0.520432386 0.937473847
[41] -0.373857248 1.349740385 0.029527591 -0.137910919 -0.181959314
[46] -1.536563248 -0.103273867 0.419223666 -0.659758284 0.534048351
[51] -1.371095052 -1.186240776 -1.652273713 -0.701094427 0.941636368
[56] -2.322203035 0.467272607 0.340501201 -1.273556226 -1.312971192
[61] 1.543070457 -1.160975877 0.701625593 -0.371480015 1.110763009
[66] 1.172396252 0.470645022 2.477479062 -2.560782496 -0.537587331
[71] 0.332810934 0.244749584 -0.602345184 1.359245797 -0.695839895
[76] 0.195074424 -0.009137362 2.275904091 0.470366765 0.970191339
[81] -1.009578989 -0.284240322 0.061315741 -2.208542551 0.380385690
[86] -1.270604996 1.960534728 -1.466678202 -1.385164705 1.611680056
[91] -0.433348538 1.194284832 -1.007620046 1.284235939 0.621070166
[96] 0.246563213 0.921459448 0.402859537 1.120541142 -0.457364326
> rowMin(tmp2)
[1] 0.437950191 -0.352461067 0.135146064 -1.361775091 -1.059915341
[6] 0.986284648 0.417650041 -1.744011453 -0.679421109 -0.323211959
[11] -0.963511466 -1.576980342 -0.176679600 -0.286206328 -0.367318502
[16] -1.309906745 1.452874729 -0.734878152 -0.261115506 -0.701725282
[21] -0.349878926 -0.342438719 0.986866879 1.244643694 -1.213820000
[26] 0.352304040 -0.680910262 -1.379637865 -0.824211697 -0.457813175
[31] 1.290852488 -0.214859619 0.728358774 2.989001442 1.084994570
[36] 1.580047474 1.598788076 1.644745732 -0.520432386 0.937473847
[41] -0.373857248 1.349740385 0.029527591 -0.137910919 -0.181959314
[46] -1.536563248 -0.103273867 0.419223666 -0.659758284 0.534048351
[51] -1.371095052 -1.186240776 -1.652273713 -0.701094427 0.941636368
[56] -2.322203035 0.467272607 0.340501201 -1.273556226 -1.312971192
[61] 1.543070457 -1.160975877 0.701625593 -0.371480015 1.110763009
[66] 1.172396252 0.470645022 2.477479062 -2.560782496 -0.537587331
[71] 0.332810934 0.244749584 -0.602345184 1.359245797 -0.695839895
[76] 0.195074424 -0.009137362 2.275904091 0.470366765 0.970191339
[81] -1.009578989 -0.284240322 0.061315741 -2.208542551 0.380385690
[86] -1.270604996 1.960534728 -1.466678202 -1.385164705 1.611680056
[91] -0.433348538 1.194284832 -1.007620046 1.284235939 0.621070166
[96] 0.246563213 0.921459448 0.402859537 1.120541142 -0.457364326
>
> colMeans(tmp2)
[1] -0.01077983
> colSums(tmp2)
[1] -1.077983
> colVars(tmp2)
[1] 1.233805
> colSd(tmp2)
[1] 1.110768
> colMax(tmp2)
[1] 2.989001
> colMin(tmp2)
[1] -2.560782
> colMedians(tmp2)
[1] -0.1572953
> colRanges(tmp2)
[,1]
[1,] -2.560782
[2,] 2.989001
>
> 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] -2.662010 5.849199 1.570022 -1.580063 2.416581 1.212150 -4.013111
[8] -1.293518 1.137196 -5.266833
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.2920230
[2,] -0.6767469
[3,] -0.6382381
[4,] 0.2963120
[5,] 0.9292680
>
> rowApply(tmp,sum)
[1] 0.6686734 1.1251359 0.3671815 -1.1473036 -1.7481108 -0.5116590
[7] -1.9136453 -0.3722241 2.5089859 -1.6074195
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 8 3 9 2 2 6 3 2 8 1
[2,] 9 9 6 9 8 9 8 6 6 3
[3,] 4 10 2 4 6 2 9 1 9 8
[4,] 7 6 1 8 7 7 2 9 4 9
[5,] 3 2 10 10 1 8 7 8 7 4
[6,] 10 5 7 1 4 4 5 5 10 10
[7,] 1 8 4 6 5 3 4 7 2 2
[8,] 6 1 3 3 10 10 6 4 3 7
[9,] 5 4 8 5 3 5 10 10 5 6
[10,] 2 7 5 7 9 1 1 3 1 5
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 2.873043382 -2.928333032 -1.197669291 0.525435848 -0.458556803
[6] -4.836858194 3.630537677 3.843909088 -0.006943592 -0.761113770
[11] 1.666216079 4.125859930 0.461224339 -4.593109887 1.689160280
[16] -0.608521249 1.096448785 0.349462801 -3.204897843 -3.329582054
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.1553387
[2,] 0.1298820
[3,] 0.1341648
[4,] 0.5584660
[5,] 2.2058692
>
> rowApply(tmp,sum)
[1] -6.84061966 -4.16597143 9.10124862 0.07617631 0.16487866
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 11 20 9 13 12
[2,] 7 5 17 4 5
[3,] 1 15 18 12 2
[4,] 9 14 6 5 17
[5,] 8 10 1 18 15
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.1553387 -1.064227 -2.1765817 -0.5132562 -0.7929924 -1.6017663844
[2,] 2.2058692 -1.424250 0.5342834 0.3196836 0.1905799 -1.0421708138
[3,] 0.1341648 1.705923 2.0127088 -0.1583226 -1.6672876 -1.1993751633
[4,] 0.1298820 -0.563865 0.1161794 -0.3848839 0.7524204 -0.9932286913
[5,] 0.5584660 -1.581913 -1.6842592 1.2622151 1.0587228 -0.0003171413
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 2.2726940 0.5793702 -2.11880029 0.47807042 0.39290607 1.32394677
[2,] -1.5674504 0.6046565 0.54429594 -2.20323423 0.30825816 0.04017732
[3,] 2.7133090 0.5685915 3.23128532 -0.03366064 -0.09698581 1.58281046
[4,] 0.5981618 1.0688516 -0.07243184 0.13998010 -0.11399341 1.27430727
[5,] -0.3861766 1.0224393 -1.59129274 0.85773058 1.17603106 -0.09538189
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 1.3642658 -1.9214948 0.3706390 -1.1861577 -0.2317004 0.21249791
[2,] 0.2032053 0.2788005 -0.8096485 -0.9266417 0.9997729 1.55990941
[3,] 0.9086169 -1.0876227 0.1840312 0.3751373 -0.2284576 -1.18219527
[4,] -0.3679646 -1.2445937 0.5887134 -0.1837096 -0.9930547 0.06544971
[5,] -1.6468989 -0.6181992 1.3554252 1.3128505 1.5498886 -0.30619896
[,19] [,20]
[1,] -2.10596399 0.0332696
[2,] -1.77811311 -2.2039544
[3,] 0.75789768 0.5806805
[4,] -0.09653727 0.3564934
[5,] 0.01781884 -2.0960712
>
>
> 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.22-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.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 652 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-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.22-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 1.376678 -1.120848 0.2935283 -0.4057148 -0.1304363 3.10121 -0.9425033
col8 col9 col10 col11 col12 col13 col14
row1 -1.994795 0.5973524 0.760773 -0.8605004 0.9992092 -0.6279148 1.213818
col15 col16 col17 col18 col19 col20
row1 -0.8639583 -0.1143581 1.102147 -0.1466979 -0.1990226 -0.2777398
> tmp[,"col10"]
col10
row1 0.7607730
row2 2.2680422
row3 -1.0120593
row4 -1.2068170
row5 -0.9472318
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 1.3766775 -1.12084797 0.2935283 -0.4057148 -0.1304363 3.101210 -0.9425033
row5 0.4823187 0.09062697 0.3792790 -0.8172757 2.0315965 -3.362807 1.2439816
col8 col9 col10 col11 col12 col13
row1 -1.994795 0.5973524 0.7607730 -0.8605004 0.9992092 -0.6279148
row5 1.439047 -0.5691477 -0.9472318 -0.3419331 -0.8410299 0.9396051
col14 col15 col16 col17 col18 col19
row1 1.2138181 -0.8639583 -0.1143581 1.1021470 -0.1466979 -0.1990226
row5 -0.1428004 -0.1885189 -0.6515692 0.2180208 0.4348257 -1.9071403
col20
row1 -0.2777398
row5 -0.7999091
> tmp[,c("col6","col20")]
col6 col20
row1 3.1012098 -0.2777398
row2 -0.2731289 -0.3457186
row3 -0.9149043 0.3818306
row4 -0.4753723 1.9905282
row5 -3.3628067 -0.7999091
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 3.101210 -0.2777398
row5 -3.362807 -0.7999091
>
>
>
>
> 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.73187 51.31895 50.98005 51.11849 50.39968 105.0276 49.11961 47.87498
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.21217 50.05179 49.94289 48.11176 48.89134 49.7372 49.11495 49.62222
col17 col18 col19 col20
row1 49.61234 50.79524 49.1923 104.9476
> tmp[,"col10"]
col10
row1 50.05179
row2 29.96427
row3 31.10646
row4 29.11893
row5 50.26428
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 51.73187 51.31895 50.98005 51.11849 50.39968 105.0276 49.11961 47.87498
row5 49.07722 50.04018 51.55034 49.98955 50.34234 105.2939 51.03061 49.24480
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.21217 50.05179 49.94289 48.11176 48.89134 49.73720 49.11495 49.62222
row5 48.81242 50.26428 50.17462 50.15100 49.00934 52.13729 51.03388 50.14190
col17 col18 col19 col20
row1 49.61234 50.79524 49.19230 104.9476
row5 51.89625 51.28551 49.97063 104.4691
> tmp[,c("col6","col20")]
col6 col20
row1 105.02756 104.94762
row2 74.00161 73.74195
row3 75.04432 74.49528
row4 75.82745 74.35738
row5 105.29393 104.46907
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.0276 104.9476
row5 105.2939 104.4691
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.0276 104.9476
row5 105.2939 104.4691
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.9240978
[2,] -1.2194532
[3,] 1.6260813
[4,] 0.1487096
[5,] -0.2677881
> tmp[,c("col17","col7")]
col17 col7
[1,] 2.1303013 1.0324517
[2,] 0.3944481 1.0554599
[3,] -0.2514191 2.2545945
[4,] 0.8631524 0.9358572
[5,] 0.1639027 1.0687342
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -1.17564317 -0.918349666
[2,] 0.01999176 -0.001509751
[3,] 0.18381640 -0.470363343
[4,] 2.72323886 -0.527169757
[5,] 0.13189423 0.130684610
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -1.175643
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -1.17564317
[2,] 0.01999176
>
>
>
> 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.1979163 -0.6961043 -0.4626641 -0.5264197 -0.3242868 -1.9419550 1.075313
row1 1.0816779 0.6038503 -0.7285570 -0.2050964 0.6182920 -0.5710063 1.160648
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 0.04792777 -0.1979146 0.09202818 -0.241292 1.7110776 0.6100503 0.1268657
row1 0.12206418 1.6723575 -0.10851027 1.079244 -0.3960778 0.3910580 0.5413126
[,15] [,16] [,17] [,18] [,19] [,20]
row3 -1.0975193 1.500153 0.05663761 -1.649816 -1.4178053 -0.7523962
row1 -0.7790092 -1.693386 -1.20960906 -0.225941 -0.5159903 1.3878570
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -2.984312 0.001327928 -1.048189 1.392873 -1.610615 0.4199977 -0.3566983
[,8] [,9] [,10]
row2 0.6574064 -0.9641279 0.06843583
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.3378969 1.052604 0.1708023 0.1520123 -0.7340243 -0.6681464 0.9581225
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.1595858 -0.1260262 0.2140769 0.1813128 -0.6704555 -0.5689413 -0.3994159
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.1439344 0.04684754 -2.02935 -1.289776 0.2182872 -1.586143
>
>
> 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: 0x643058301f10>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30cdb2477977a0"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30cdb2729c220c"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30cdb2fe8c411"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30cdb22a86470"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30cdb21c756445"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30cdb2227ec23e"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30cdb264a11730"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30cdb22bd0513c"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30cdb27e9c4ce9"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30cdb233ec40e9"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30cdb234e39792"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30cdb22bd23cdc"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30cdb2442f597"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30cdb21147d41f"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM30cdb23e48f302"
>
>
> ### 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: 0x643059ac4240>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x643059ac4240>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x643059ac4240>
> rowMedians(tmp)
[1] -0.2537668818 0.3003069425 -0.0657270012 0.3067325183 0.2920867710
[6] 0.1987743026 0.0324574938 0.5985595166 0.1104279048 0.3229763604
[11] -0.2979003076 0.8907368298 0.3757869045 0.2357430875 0.1215231563
[16] -0.4967597424 -0.1605200318 -0.0269420352 -0.3613925651 0.1262147065
[21] 0.2432317599 -0.0915833830 0.0427888790 -0.2496707625 -0.0218620567
[26] 0.6236836532 -0.0882900019 0.0443813328 -0.1086215680 -0.1693401978
[31] -0.0487927302 0.2384229920 -0.2553543914 -0.1475962807 -0.6448238393
[36] 0.3166818845 -0.3883878958 0.3194635291 -0.0349142669 0.2081313502
[41] -0.2732870356 0.1253260568 0.3843991173 -0.3137490201 0.0819377563
[46] 0.1703511427 -0.0132487203 -0.5635180933 -0.4266522665 0.1966530653
[51] 0.4542528369 -0.0582024442 0.2876427378 -0.1993664215 0.1384009746
[56] -0.0153034783 0.1692885070 -0.1287828777 0.4115418225 0.0276758775
[61] -0.4375907152 -0.9412422522 0.9637346252 0.3230825200 0.5258480196
[66] -0.5019798638 -0.4172191778 -0.0084376403 0.4072456192 -0.2466135280
[71] -0.4485423676 0.1124953775 0.3091664539 -0.0322119191 0.7677228371
[76] -0.6064813378 0.0293643549 0.2772259183 -0.0365424021 0.2401699570
[81] 0.2274152090 -0.2347459787 -0.2705558967 0.2580417890 -0.0566903079
[86] 0.1312276332 -0.0941637319 -0.0400685379 0.1109278135 -0.2081932643
[91] 0.1777589055 0.0917075629 -0.2645530517 -0.0277162127 0.0293344012
[96] 0.0986737687 0.3760450221 0.1405132959 -0.6870651049 0.2426341912
[101] -0.0572781377 0.1213891988 -0.0999814645 -0.2810416222 -0.2190647797
[106] -0.0590843152 -0.6371038482 -0.2644373643 -0.1181844820 0.1092535505
[111] 0.2974099508 0.5455370171 0.1260181422 -0.3275478086 -0.0454612791
[116] -0.0638876225 -0.0198773038 -0.0774663227 0.0027211402 0.5786802422
[121] -0.0087731705 0.4360461689 -0.3319144894 -0.0736897329 -0.2074023229
[126] 0.1668052100 -0.5393587223 0.4637664306 0.2545922296 0.1984555391
[131] -0.0455339998 -0.4389000826 0.4408367570 -0.2692062285 0.4686442928
[136] 0.0377546213 -0.2705807686 0.7275590293 -0.0241368111 0.4021100807
[141] 0.3374936908 -0.0911068102 -0.4103372948 -0.3930725051 -0.2679485795
[146] -0.6758169127 -0.1361389895 0.2659352709 0.1124522042 0.4745174539
[151] 0.1839593122 -0.7616559333 0.0322473520 0.3955523482 -0.1145044438
[156] 0.6856887134 0.4398879736 0.5417920200 0.1305721021 0.3144610721
[161] -0.2747472598 -0.0657376672 -0.0680592306 0.3309588565 -0.3093351007
[166] -0.4670393198 0.1678843088 -0.4477138309 0.1609815426 0.3985691605
[171] -0.5814356919 -0.3991621597 0.6320862688 0.2273228816 -0.2425040150
[176] -0.4511666214 -0.4143451884 -0.0501585085 -0.0717738300 0.1989265129
[181] 0.1383931475 -0.0944252539 -0.1145651506 0.5454324995 0.1244789996
[186] 0.0165386044 0.1637491099 0.0194080585 -0.0878498476 -0.5165105230
[191] 0.3465026175 -0.1215832186 -0.2314933622 -0.4180501128 0.3401979195
[196] 0.4310707816 0.2205873987 0.2186629094 -0.1995681275 -0.5666631652
[201] 0.1793031106 -0.0723932065 -0.4159172076 -0.0188479361 -0.1423226934
[206] -0.3188402292 0.0747572307 -0.0650147597 -0.6355793400 -0.1846799363
[211] -0.0076061212 0.0668706494 -0.7477067415 0.2419356338 0.0008807081
[216] 0.1293573624 -0.6878878950 -0.2388001526 0.2119262165 0.0972933212
[221] -0.0060374844 0.0073933816 0.2138106603 -0.6444045660 -0.2179256979
[226] 0.1324196963 -0.7834610906 0.2887595667 -0.6288817897 -0.2903336025
>
> proc.time()
user system elapsed
1.212 0.666 1.867
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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: 0x594bc12fd370>
> .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: 0x594bc12fd370>
> .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: 0x594bc12fd370>
> .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: 0x594bc12fd370>
> 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: 0x594bc12e51c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x594bc12e51c0>
> .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: 0x594bc12e51c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x594bc12e51c0>
> .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: 0x594bc12e51c0>
> 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: 0x594bc15c8120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x594bc15c8120>
> .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: 0x594bc15c8120>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x594bc15c8120>
> .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: 0x594bc15c8120>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x594bc15c8120>
> .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: 0x594bc15c8120>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x594bc15c8120>
> .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: 0x594bc15c8120>
> 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: 0x594bc0318390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x594bc0318390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x594bc0318390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x594bc0318390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile30d0674396271d" "BufferedMatrixFile30d0677dd6bd5d"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile30d0674396271d" "BufferedMatrixFile30d0677dd6bd5d"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x594bc020f3d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x594bc020f3d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x594bc020f3d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x594bc020f3d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x594bc020f3d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x594bc020f3d0>
> .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: 0x594bc1d44fa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x594bc1d44fa0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x594bc1d44fa0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x594bc1d44fa0>
> 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: 0x594bc051cff0>
> .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: 0x594bc051cff0>
> rm(P)
>
> proc.time()
user system elapsed
0.246 0.047 0.283
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble"
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.242 0.044 0.273