| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2026-01-05 11:57 -0500 (Mon, 05 Jan 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" | 4883 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4671 |
| 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 | |||||||||
| taishan | Linux (openEuler 24.03 LTS) / aarch64 | OK | OK | OK | ||||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.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-01-01 21:37:00 -0500 (Thu, 01 Jan 2026) |
| EndedAt: 2026-01-01 21:37:25 -0500 (Thu, 01 Jan 2026) |
| EllapsedTime: 25.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.243 0.040 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 Jan 1 21:37:16 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 Jan 1 21:37:16 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: 0x57db820f2370>
>
>
>
> 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 Jan 1 21:37:16 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 Jan 1 21:37:16 2026"
>
> ColMode(tmp2)
<pointer: 0x57db820f2370>
>
>
>
> ### 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.173674 -0.32923750 0.5417562 0.9154567
[2,] 1.164219 0.82007047 -0.5619015 1.5755411
[3,] -1.328901 0.06743553 0.5023531 -0.8547482
[4,] -1.018035 -0.08192723 -1.4054566 -0.5165307
> 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.173674 0.32923750 0.5417562 0.9154567
[2,] 1.164219 0.82007047 0.5619015 1.5755411
[3,] 1.328901 0.06743553 0.5023531 0.8547482
[4,] 1.018035 0.08192723 1.4054566 0.5165307
> 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.058513 0.5737922 0.7360409 0.9567950
[2,] 1.078990 0.9055774 0.7496009 1.2552056
[3,] 1.152780 0.2596835 0.7087687 0.9245259
[4,] 1.008977 0.2862293 1.1855196 0.7187007
>
> 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.75880 31.06716 32.90217 35.48341
[2,] 36.95412 34.87584 33.05791 39.12760
[3,] 37.85670 27.66427 32.59004 35.10001
[4,] 36.10781 27.94422 38.26065 32.70354
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x57db830ee9b0>
> exp(tmp5)
<pointer: 0x57db830ee9b0>
> log(tmp5,2)
<pointer: 0x57db830ee9b0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.9687
> Min(tmp5)
[1] 55.50086
> mean(tmp5)
[1] 73.67146
> Sum(tmp5)
[1] 14734.29
> Var(tmp5)
[1] 869.8233
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.79011 71.46311 70.68284 71.77547 70.59365 70.44206 72.77569 70.19793
[9] 74.52959 73.46420
> rowSums(tmp5)
[1] 1815.802 1429.262 1413.657 1435.509 1411.873 1408.841 1455.514 1403.959
[9] 1490.592 1469.284
> rowVars(tmp5)
[1] 8087.43890 51.66517 51.52870 59.95938 43.00250 61.65280
[7] 102.01523 79.88937 109.30871 101.68782
> rowSd(tmp5)
[1] 89.930189 7.187849 7.178350 7.743344 6.557629 7.851929 10.100259
[8] 8.938085 10.455080 10.084038
> rowMax(tmp5)
[1] 471.96873 84.22999 82.57471 81.70188 84.07310 86.46001 91.34972
[8] 88.81014 92.22633 90.39639
> rowMin(tmp5)
[1] 59.00796 57.61352 57.57955 56.44984 61.65026 55.50086 56.15626 59.94814
[9] 56.58019 55.64200
>
> colMeans(tmp5)
[1] 111.35601 69.90202 73.18566 77.33085 69.26284 72.73645 69.15948
[8] 70.31890 74.21620 70.20688 73.42260 69.61993 68.28641 69.91110
[15] 71.61115 71.45519 73.13278 72.72832 72.66773 72.91879
> colSums(tmp5)
[1] 1113.5601 699.0202 731.8566 773.3085 692.6284 727.3645 691.5948
[8] 703.1890 742.1620 702.0688 734.2260 696.1993 682.8641 699.1110
[15] 716.1115 714.5519 731.3278 727.2832 726.6773 729.1879
> colVars(tmp5)
[1] 16097.85425 100.22022 126.98755 50.36812 66.39507 48.11189
[7] 95.92317 106.58172 47.52752 82.69950 33.43776 36.09697
[13] 45.61212 81.64229 98.82836 76.27545 91.75190 70.20926
[19] 48.92253 67.65279
> colSd(tmp5)
[1] 126.877320 10.011005 11.268875 7.097050 8.148317 6.936274
[7] 9.794038 10.323842 6.894021 9.093926 5.782540 6.008076
[13] 6.753674 9.035612 9.941245 8.733582 9.578721 8.379096
[19] 6.994464 8.225132
> colMax(tmp5)
[1] 471.96873 88.94117 88.81014 91.34972 86.02855 84.22999 82.12853
[8] 87.64768 85.60904 84.64863 80.86292 81.85752 78.00447 83.64210
[15] 90.39639 81.99249 88.75882 92.22633 85.81359 86.46001
> colMin(tmp5)
[1] 60.86257 57.57955 56.41658 68.06813 57.61352 63.07220 55.50086 56.15626
[9] 61.97103 56.44984 66.28960 62.94894 56.58019 60.53925 59.69066 57.69675
[17] 61.79264 63.57527 61.63431 59.12546
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 90.79011 71.46311 70.68284 71.77547 NA 70.44206 72.77569 70.19793
[9] 74.52959 73.46420
> rowSums(tmp5)
[1] 1815.802 1429.262 1413.657 1435.509 NA 1408.841 1455.514 1403.959
[9] 1490.592 1469.284
> rowVars(tmp5)
[1] 8087.43890 51.66517 51.52870 59.95938 37.97194 61.65280
[7] 102.01523 79.88937 109.30871 101.68782
> rowSd(tmp5)
[1] 89.930189 7.187849 7.178350 7.743344 6.162138 7.851929 10.100259
[8] 8.938085 10.455080 10.084038
> rowMax(tmp5)
[1] 471.96873 84.22999 82.57471 81.70188 NA 86.46001 91.34972
[8] 88.81014 92.22633 90.39639
> rowMin(tmp5)
[1] 59.00796 57.61352 57.57955 56.44984 NA 55.50086 56.15626 59.94814
[9] 56.58019 55.64200
>
> colMeans(tmp5)
[1] 111.35601 69.90202 73.18566 77.33085 69.26284 72.73645 69.15948
[8] 70.31890 74.21620 70.20688 73.42260 NA 68.28641 69.91110
[15] 71.61115 71.45519 73.13278 72.72832 72.66773 72.91879
> colSums(tmp5)
[1] 1113.5601 699.0202 731.8566 773.3085 692.6284 727.3645 691.5948
[8] 703.1890 742.1620 702.0688 734.2260 NA 682.8641 699.1110
[15] 716.1115 714.5519 731.3278 727.2832 726.6773 729.1879
> colVars(tmp5)
[1] 16097.85425 100.22022 126.98755 50.36812 66.39507 48.11189
[7] 95.92317 106.58172 47.52752 82.69950 33.43776 NA
[13] 45.61212 81.64229 98.82836 76.27545 91.75190 70.20926
[19] 48.92253 67.65279
> colSd(tmp5)
[1] 126.877320 10.011005 11.268875 7.097050 8.148317 6.936274
[7] 9.794038 10.323842 6.894021 9.093926 5.782540 NA
[13] 6.753674 9.035612 9.941245 8.733582 9.578721 8.379096
[19] 6.994464 8.225132
> colMax(tmp5)
[1] 471.96873 88.94117 88.81014 91.34972 86.02855 84.22999 82.12853
[8] 87.64768 85.60904 84.64863 80.86292 NA 78.00447 83.64210
[15] 90.39639 81.99249 88.75882 92.22633 85.81359 86.46001
> colMin(tmp5)
[1] 60.86257 57.57955 56.41658 68.06813 57.61352 63.07220 55.50086 56.15626
[9] 61.97103 56.44984 66.28960 NA 56.58019 60.53925 59.69066 57.69675
[17] 61.79264 63.57527 61.63431 59.12546
>
> Max(tmp5,na.rm=TRUE)
[1] 471.9687
> Min(tmp5,na.rm=TRUE)
[1] 55.50086
> mean(tmp5,na.rm=TRUE)
[1] 73.63033
> Sum(tmp5,na.rm=TRUE)
[1] 14652.44
> Var(tmp5,na.rm=TRUE)
[1] 873.8762
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.79011 71.46311 70.68284 71.77547 70.00081 70.44206 72.77569 70.19793
[9] 74.52959 73.46420
> rowSums(tmp5,na.rm=TRUE)
[1] 1815.802 1429.262 1413.657 1435.509 1330.015 1408.841 1455.514 1403.959
[9] 1490.592 1469.284
> rowVars(tmp5,na.rm=TRUE)
[1] 8087.43890 51.66517 51.52870 59.95938 37.97194 61.65280
[7] 102.01523 79.88937 109.30871 101.68782
> rowSd(tmp5,na.rm=TRUE)
[1] 89.930189 7.187849 7.178350 7.743344 6.162138 7.851929 10.100259
[8] 8.938085 10.455080 10.084038
> rowMax(tmp5,na.rm=TRUE)
[1] 471.96873 84.22999 82.57471 81.70188 84.07310 86.46001 91.34972
[8] 88.81014 92.22633 90.39639
> rowMin(tmp5,na.rm=TRUE)
[1] 59.00796 57.61352 57.57955 56.44984 61.65026 55.50086 56.15626 59.94814
[9] 56.58019 55.64200
>
> colMeans(tmp5,na.rm=TRUE)
[1] 111.35601 69.90202 73.18566 77.33085 69.26284 72.73645 69.15948
[8] 70.31890 74.21620 70.20688 73.42260 68.26020 68.28641 69.91110
[15] 71.61115 71.45519 73.13278 72.72832 72.66773 72.91879
> colSums(tmp5,na.rm=TRUE)
[1] 1113.5601 699.0202 731.8566 773.3085 692.6284 727.3645 691.5948
[8] 703.1890 742.1620 702.0688 734.2260 614.3418 682.8641 699.1110
[15] 716.1115 714.5519 731.3278 727.2832 726.6773 729.1879
> colVars(tmp5,na.rm=TRUE)
[1] 16097.85425 100.22022 126.98755 50.36812 66.39507 48.11189
[7] 95.92317 106.58172 47.52752 82.69950 33.43776 19.80930
[13] 45.61212 81.64229 98.82836 76.27545 91.75190 70.20926
[19] 48.92253 67.65279
> colSd(tmp5,na.rm=TRUE)
[1] 126.877320 10.011005 11.268875 7.097050 8.148317 6.936274
[7] 9.794038 10.323842 6.894021 9.093926 5.782540 4.450764
[13] 6.753674 9.035612 9.941245 8.733582 9.578721 8.379096
[19] 6.994464 8.225132
> colMax(tmp5,na.rm=TRUE)
[1] 471.96873 88.94117 88.81014 91.34972 86.02855 84.22999 82.12853
[8] 87.64768 85.60904 84.64863 80.86292 77.69918 78.00447 83.64210
[15] 90.39639 81.99249 88.75882 92.22633 85.81359 86.46001
> colMin(tmp5,na.rm=TRUE)
[1] 60.86257 57.57955 56.41658 68.06813 57.61352 63.07220 55.50086 56.15626
[9] 61.97103 56.44984 66.28960 62.94894 56.58019 60.53925 59.69066 57.69675
[17] 61.79264 63.57527 61.63431 59.12546
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.79011 71.46311 70.68284 71.77547 NaN 70.44206 72.77569 70.19793
[9] 74.52959 73.46420
> rowSums(tmp5,na.rm=TRUE)
[1] 1815.802 1429.262 1413.657 1435.509 0.000 1408.841 1455.514 1403.959
[9] 1490.592 1469.284
> rowVars(tmp5,na.rm=TRUE)
[1] 8087.43890 51.66517 51.52870 59.95938 NA 61.65280
[7] 102.01523 79.88937 109.30871 101.68782
> rowSd(tmp5,na.rm=TRUE)
[1] 89.930189 7.187849 7.178350 7.743344 NA 7.851929 10.100259
[8] 8.938085 10.455080 10.084038
> rowMax(tmp5,na.rm=TRUE)
[1] 471.96873 84.22999 82.57471 81.70188 NA 86.46001 91.34972
[8] 88.81014 92.22633 90.39639
> rowMin(tmp5,na.rm=TRUE)
[1] 59.00796 57.61352 57.57955 56.44984 NA 55.50086 56.15626 59.94814
[9] 56.58019 55.64200
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 116.43820 69.65411 71.97594 77.77330 69.79137 73.64469 69.48073
[8] 70.74693 74.40178 71.15762 72.92374 NaN 68.88077 70.79554
[15] 71.66425 71.06781 72.52086 73.26146 72.82572 73.00388
> colSums(tmp5,na.rm=TRUE)
[1] 1047.9438 626.8870 647.7835 699.9597 628.1223 662.8022 625.3266
[8] 636.7223 669.6160 640.4186 656.3136 0.0000 619.9269 637.1599
[15] 644.9783 639.6103 652.6877 659.3531 655.4315 657.0350
> colVars(tmp5,na.rm=TRUE)
[1] 17819.51306 112.05635 126.39760 54.46179 71.55182 44.84588
[7] 106.75258 117.84335 53.08103 82.86807 34.81779 NA
[13] 47.33951 83.04745 111.15017 84.12165 99.00833 75.78781
[19] 54.75704 76.02792
> colSd(tmp5,na.rm=TRUE)
[1] 133.489749 10.585667 11.242669 7.379823 8.458831 6.696706
[7] 10.332114 10.855567 7.285673 9.103190 5.900660 NA
[13] 6.880371 9.113037 10.542778 9.171785 9.950293 8.705620
[19] 7.399800 8.719399
> colMax(tmp5,na.rm=TRUE)
[1] 471.96873 88.94117 88.81014 91.34972 86.02855 84.22999 82.12853
[8] 87.64768 85.60904 84.64863 80.86292 -Inf 78.00447 83.64210
[15] 90.39639 81.99249 88.75882 92.22633 85.81359 86.46001
> colMin(tmp5,na.rm=TRUE)
[1] 60.86257 57.57955 56.41658 68.06813 57.61352 63.07220 55.50086 56.15626
[9] 61.97103 56.44984 66.28960 Inf 56.58019 60.53925 59.69066 57.69675
[17] 61.79264 63.57527 61.63431 59.12546
>
>
>
>
> 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] 153.7233 407.8144 210.1696 245.3430 171.9007 183.8809 209.2131 323.5209
[9] 241.0395 219.2890
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 153.7233 407.8144 210.1696 245.3430 171.9007 183.8809 209.2131 323.5209
[9] 241.0395 219.2890
>
>
>
> 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] 5.684342e-14 2.842171e-13 -5.684342e-14 1.136868e-13 -2.842171e-14
[6] -4.547474e-13 -1.421085e-14 0.000000e+00 1.136868e-13 -1.278977e-13
[11] 1.421085e-14 5.684342e-14 1.421085e-14 1.421085e-13 8.526513e-14
[16] 4.263256e-14 -8.526513e-14 1.136868e-13 -1.136868e-13 4.263256e-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)
+ }
4 16
8 14
8 18
8 18
3 13
10 4
10 15
7 18
1 13
7 1
8 13
7 14
10 14
5 10
4 8
5 13
9 19
7 9
2 20
8 15
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.51151
> Min(tmp)
[1] -2.090545
> mean(tmp)
[1] -0.05614492
> Sum(tmp)
[1] -5.614492
> Var(tmp)
[1] 0.8928896
>
> rowMeans(tmp)
[1] -0.05614492
> rowSums(tmp)
[1] -5.614492
> rowVars(tmp)
[1] 0.8928896
> rowSd(tmp)
[1] 0.9449284
> rowMax(tmp)
[1] 2.51151
> rowMin(tmp)
[1] -2.090545
>
> colMeans(tmp)
[1] -1.4781507965 -0.7425413504 0.8162763727 1.3329583484 -1.1795044962
[6] -1.1360588128 0.6029380169 -0.3584506808 -0.2463377307 -1.8628208940
[11] -1.2998470363 0.5740524428 -0.1705227978 0.0478279350 0.5511468531
[16] -0.5669810914 -1.8508170232 0.1383819720 -1.0300205374 -0.0976686529
[21] -0.8961456266 0.7657123567 -0.1829950604 -0.6959742617 -1.5655009854
[26] 1.2529845888 -1.4419404063 1.1992526781 0.2792170146 0.5634495965
[31] -0.4875284189 0.2033525930 1.2498828221 0.2124912741 0.5671661346
[36] -0.7926742986 -0.1141714654 0.5584975895 0.0009404089 -0.8052490782
[41] 0.2099806722 0.0152311405 1.1083174791 0.0088595687 1.6279786356
[46] -1.8513963155 -0.2324098496 -1.0335263528 -1.3035243985 -0.2055378182
[51] 0.3498158022 0.2384898459 0.4625795653 0.3653943344 -0.3211656049
[56] 0.1224301129 1.8298818844 -0.2787632321 -0.3611866200 0.9094046929
[61] -0.7795443389 0.3064171185 -0.4436451079 1.6563966591 -1.1685419303
[66] -0.8489534662 1.1589094538 0.5839294135 -0.1560258891 0.0836982806
[71] -0.8690597793 0.1271148595 0.4552807566 -1.8149399832 1.1950224758
[76] -1.2582908290 0.2869974955 0.5567010726 -0.9363091019 -1.2255685897
[81] 0.7813292541 -2.0905446605 0.3422633810 0.8258794657 1.4370808902
[86] -1.1300932933 -1.0619960426 0.6804119096 -0.2792697140 0.3682068952
[91] 0.0267754944 2.5115104491 -0.1000608086 -0.8521056078 0.3555605669
[96] -0.8134964345 1.9685522070 -0.0187628324 0.1929852123 0.7562124966
> colSums(tmp)
[1] -1.4781507965 -0.7425413504 0.8162763727 1.3329583484 -1.1795044962
[6] -1.1360588128 0.6029380169 -0.3584506808 -0.2463377307 -1.8628208940
[11] -1.2998470363 0.5740524428 -0.1705227978 0.0478279350 0.5511468531
[16] -0.5669810914 -1.8508170232 0.1383819720 -1.0300205374 -0.0976686529
[21] -0.8961456266 0.7657123567 -0.1829950604 -0.6959742617 -1.5655009854
[26] 1.2529845888 -1.4419404063 1.1992526781 0.2792170146 0.5634495965
[31] -0.4875284189 0.2033525930 1.2498828221 0.2124912741 0.5671661346
[36] -0.7926742986 -0.1141714654 0.5584975895 0.0009404089 -0.8052490782
[41] 0.2099806722 0.0152311405 1.1083174791 0.0088595687 1.6279786356
[46] -1.8513963155 -0.2324098496 -1.0335263528 -1.3035243985 -0.2055378182
[51] 0.3498158022 0.2384898459 0.4625795653 0.3653943344 -0.3211656049
[56] 0.1224301129 1.8298818844 -0.2787632321 -0.3611866200 0.9094046929
[61] -0.7795443389 0.3064171185 -0.4436451079 1.6563966591 -1.1685419303
[66] -0.8489534662 1.1589094538 0.5839294135 -0.1560258891 0.0836982806
[71] -0.8690597793 0.1271148595 0.4552807566 -1.8149399832 1.1950224758
[76] -1.2582908290 0.2869974955 0.5567010726 -0.9363091019 -1.2255685897
[81] 0.7813292541 -2.0905446605 0.3422633810 0.8258794657 1.4370808902
[86] -1.1300932933 -1.0619960426 0.6804119096 -0.2792697140 0.3682068952
[91] 0.0267754944 2.5115104491 -0.1000608086 -0.8521056078 0.3555605669
[96] -0.8134964345 1.9685522070 -0.0187628324 0.1929852123 0.7562124966
> 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] -1.4781507965 -0.7425413504 0.8162763727 1.3329583484 -1.1795044962
[6] -1.1360588128 0.6029380169 -0.3584506808 -0.2463377307 -1.8628208940
[11] -1.2998470363 0.5740524428 -0.1705227978 0.0478279350 0.5511468531
[16] -0.5669810914 -1.8508170232 0.1383819720 -1.0300205374 -0.0976686529
[21] -0.8961456266 0.7657123567 -0.1829950604 -0.6959742617 -1.5655009854
[26] 1.2529845888 -1.4419404063 1.1992526781 0.2792170146 0.5634495965
[31] -0.4875284189 0.2033525930 1.2498828221 0.2124912741 0.5671661346
[36] -0.7926742986 -0.1141714654 0.5584975895 0.0009404089 -0.8052490782
[41] 0.2099806722 0.0152311405 1.1083174791 0.0088595687 1.6279786356
[46] -1.8513963155 -0.2324098496 -1.0335263528 -1.3035243985 -0.2055378182
[51] 0.3498158022 0.2384898459 0.4625795653 0.3653943344 -0.3211656049
[56] 0.1224301129 1.8298818844 -0.2787632321 -0.3611866200 0.9094046929
[61] -0.7795443389 0.3064171185 -0.4436451079 1.6563966591 -1.1685419303
[66] -0.8489534662 1.1589094538 0.5839294135 -0.1560258891 0.0836982806
[71] -0.8690597793 0.1271148595 0.4552807566 -1.8149399832 1.1950224758
[76] -1.2582908290 0.2869974955 0.5567010726 -0.9363091019 -1.2255685897
[81] 0.7813292541 -2.0905446605 0.3422633810 0.8258794657 1.4370808902
[86] -1.1300932933 -1.0619960426 0.6804119096 -0.2792697140 0.3682068952
[91] 0.0267754944 2.5115104491 -0.1000608086 -0.8521056078 0.3555605669
[96] -0.8134964345 1.9685522070 -0.0187628324 0.1929852123 0.7562124966
> colMin(tmp)
[1] -1.4781507965 -0.7425413504 0.8162763727 1.3329583484 -1.1795044962
[6] -1.1360588128 0.6029380169 -0.3584506808 -0.2463377307 -1.8628208940
[11] -1.2998470363 0.5740524428 -0.1705227978 0.0478279350 0.5511468531
[16] -0.5669810914 -1.8508170232 0.1383819720 -1.0300205374 -0.0976686529
[21] -0.8961456266 0.7657123567 -0.1829950604 -0.6959742617 -1.5655009854
[26] 1.2529845888 -1.4419404063 1.1992526781 0.2792170146 0.5634495965
[31] -0.4875284189 0.2033525930 1.2498828221 0.2124912741 0.5671661346
[36] -0.7926742986 -0.1141714654 0.5584975895 0.0009404089 -0.8052490782
[41] 0.2099806722 0.0152311405 1.1083174791 0.0088595687 1.6279786356
[46] -1.8513963155 -0.2324098496 -1.0335263528 -1.3035243985 -0.2055378182
[51] 0.3498158022 0.2384898459 0.4625795653 0.3653943344 -0.3211656049
[56] 0.1224301129 1.8298818844 -0.2787632321 -0.3611866200 0.9094046929
[61] -0.7795443389 0.3064171185 -0.4436451079 1.6563966591 -1.1685419303
[66] -0.8489534662 1.1589094538 0.5839294135 -0.1560258891 0.0836982806
[71] -0.8690597793 0.1271148595 0.4552807566 -1.8149399832 1.1950224758
[76] -1.2582908290 0.2869974955 0.5567010726 -0.9363091019 -1.2255685897
[81] 0.7813292541 -2.0905446605 0.3422633810 0.8258794657 1.4370808902
[86] -1.1300932933 -1.0619960426 0.6804119096 -0.2792697140 0.3682068952
[91] 0.0267754944 2.5115104491 -0.1000608086 -0.8521056078 0.3555605669
[96] -0.8134964345 1.9685522070 -0.0187628324 0.1929852123 0.7562124966
> colMedians(tmp)
[1] -1.4781507965 -0.7425413504 0.8162763727 1.3329583484 -1.1795044962
[6] -1.1360588128 0.6029380169 -0.3584506808 -0.2463377307 -1.8628208940
[11] -1.2998470363 0.5740524428 -0.1705227978 0.0478279350 0.5511468531
[16] -0.5669810914 -1.8508170232 0.1383819720 -1.0300205374 -0.0976686529
[21] -0.8961456266 0.7657123567 -0.1829950604 -0.6959742617 -1.5655009854
[26] 1.2529845888 -1.4419404063 1.1992526781 0.2792170146 0.5634495965
[31] -0.4875284189 0.2033525930 1.2498828221 0.2124912741 0.5671661346
[36] -0.7926742986 -0.1141714654 0.5584975895 0.0009404089 -0.8052490782
[41] 0.2099806722 0.0152311405 1.1083174791 0.0088595687 1.6279786356
[46] -1.8513963155 -0.2324098496 -1.0335263528 -1.3035243985 -0.2055378182
[51] 0.3498158022 0.2384898459 0.4625795653 0.3653943344 -0.3211656049
[56] 0.1224301129 1.8298818844 -0.2787632321 -0.3611866200 0.9094046929
[61] -0.7795443389 0.3064171185 -0.4436451079 1.6563966591 -1.1685419303
[66] -0.8489534662 1.1589094538 0.5839294135 -0.1560258891 0.0836982806
[71] -0.8690597793 0.1271148595 0.4552807566 -1.8149399832 1.1950224758
[76] -1.2582908290 0.2869974955 0.5567010726 -0.9363091019 -1.2255685897
[81] 0.7813292541 -2.0905446605 0.3422633810 0.8258794657 1.4370808902
[86] -1.1300932933 -1.0619960426 0.6804119096 -0.2792697140 0.3682068952
[91] 0.0267754944 2.5115104491 -0.1000608086 -0.8521056078 0.3555605669
[96] -0.8134964345 1.9685522070 -0.0187628324 0.1929852123 0.7562124966
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -1.478151 -0.7425414 0.8162764 1.332958 -1.179504 -1.136059 0.602938
[2,] -1.478151 -0.7425414 0.8162764 1.332958 -1.179504 -1.136059 0.602938
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.3584507 -0.2463377 -1.862821 -1.299847 0.5740524 -0.1705228 0.04782794
[2,] -0.3584507 -0.2463377 -1.862821 -1.299847 0.5740524 -0.1705228 0.04782794
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.5511469 -0.5669811 -1.850817 0.138382 -1.030021 -0.09766865 -0.8961456
[2,] 0.5511469 -0.5669811 -1.850817 0.138382 -1.030021 -0.09766865 -0.8961456
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.7657124 -0.1829951 -0.6959743 -1.565501 1.252985 -1.44194 1.199253
[2,] 0.7657124 -0.1829951 -0.6959743 -1.565501 1.252985 -1.44194 1.199253
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.279217 0.5634496 -0.4875284 0.2033526 1.249883 0.2124913 0.5671661
[2,] 0.279217 0.5634496 -0.4875284 0.2033526 1.249883 0.2124913 0.5671661
[,36] [,37] [,38] [,39] [,40] [,41]
[1,] -0.7926743 -0.1141715 0.5584976 0.0009404089 -0.8052491 0.2099807
[2,] -0.7926743 -0.1141715 0.5584976 0.0009404089 -0.8052491 0.2099807
[,42] [,43] [,44] [,45] [,46] [,47] [,48]
[1,] 0.01523114 1.108317 0.008859569 1.627979 -1.851396 -0.2324098 -1.033526
[2,] 0.01523114 1.108317 0.008859569 1.627979 -1.851396 -0.2324098 -1.033526
[,49] [,50] [,51] [,52] [,53] [,54] [,55]
[1,] -1.303524 -0.2055378 0.3498158 0.2384898 0.4625796 0.3653943 -0.3211656
[2,] -1.303524 -0.2055378 0.3498158 0.2384898 0.4625796 0.3653943 -0.3211656
[,56] [,57] [,58] [,59] [,60] [,61] [,62]
[1,] 0.1224301 1.829882 -0.2787632 -0.3611866 0.9094047 -0.7795443 0.3064171
[2,] 0.1224301 1.829882 -0.2787632 -0.3611866 0.9094047 -0.7795443 0.3064171
[,63] [,64] [,65] [,66] [,67] [,68] [,69]
[1,] -0.4436451 1.656397 -1.168542 -0.8489535 1.158909 0.5839294 -0.1560259
[2,] -0.4436451 1.656397 -1.168542 -0.8489535 1.158909 0.5839294 -0.1560259
[,70] [,71] [,72] [,73] [,74] [,75] [,76]
[1,] 0.08369828 -0.8690598 0.1271149 0.4552808 -1.81494 1.195022 -1.258291
[2,] 0.08369828 -0.8690598 0.1271149 0.4552808 -1.81494 1.195022 -1.258291
[,77] [,78] [,79] [,80] [,81] [,82] [,83]
[1,] 0.2869975 0.5567011 -0.9363091 -1.225569 0.7813293 -2.090545 0.3422634
[2,] 0.2869975 0.5567011 -0.9363091 -1.225569 0.7813293 -2.090545 0.3422634
[,84] [,85] [,86] [,87] [,88] [,89] [,90]
[1,] 0.8258795 1.437081 -1.130093 -1.061996 0.6804119 -0.2792697 0.3682069
[2,] 0.8258795 1.437081 -1.130093 -1.061996 0.6804119 -0.2792697 0.3682069
[,91] [,92] [,93] [,94] [,95] [,96] [,97]
[1,] 0.02677549 2.51151 -0.1000608 -0.8521056 0.3555606 -0.8134964 1.968552
[2,] 0.02677549 2.51151 -0.1000608 -0.8521056 0.3555606 -0.8134964 1.968552
[,98] [,99] [,100]
[1,] -0.01876283 0.1929852 0.7562125
[2,] -0.01876283 0.1929852 0.7562125
>
>
> Max(tmp2)
[1] 2.481448
> Min(tmp2)
[1] -3.001611
> mean(tmp2)
[1] -0.03092374
> Sum(tmp2)
[1] -3.092374
> Var(tmp2)
[1] 1.069141
>
> rowMeans(tmp2)
[1] -3.001611266 -0.538322088 -2.122552474 -0.495129261 -1.304838551
[6] 0.373878119 1.588671845 -0.266861795 0.226975833 0.337689000
[11] 2.481447784 -0.889724688 0.264200377 -1.512420493 0.814536292
[16] -1.133012345 -0.335727926 0.092907624 -1.475513500 -0.995488130
[21] -0.116911058 0.628159707 1.323660274 -0.953530128 -1.148372105
[26] 0.161143595 -1.101771100 1.659609358 0.949642859 -0.048529024
[31] 0.052984621 0.979178683 -0.172937517 0.965964579 0.325894775
[36] 0.291939578 -0.659800684 -0.447013635 -0.301769074 -1.183566391
[41] 0.326758608 -0.035458945 0.393125727 -1.021941629 -0.470227201
[46] -0.671596177 0.558094251 0.146207013 0.254394317 -1.093803864
[51] -1.894427715 0.122418411 0.535455649 0.729814740 0.388268667
[56] 0.523486420 -0.040346413 1.207316464 -1.359800810 0.451055018
[61] 2.105638088 0.856425949 -1.291122736 0.721172937 -1.001565380
[66] -2.258822372 -1.043105082 0.036311261 0.698170507 -0.776545322
[71] 1.223072483 -0.157258082 -1.155716413 -0.263374784 0.653627382
[76] 0.536337474 -1.480692243 -0.007882322 -1.804755067 0.587068986
[81] 1.665451536 0.552115867 1.634715867 -0.475141685 -1.454775150
[86] 0.722036127 0.784627159 0.029450789 1.235161663 -1.299080723
[91] 0.701172968 -0.803339192 1.322903779 0.077137211 0.858822517
[96] 1.890220233 -0.314787458 -0.603986164 1.365862633 0.480198443
> rowSums(tmp2)
[1] -3.001611266 -0.538322088 -2.122552474 -0.495129261 -1.304838551
[6] 0.373878119 1.588671845 -0.266861795 0.226975833 0.337689000
[11] 2.481447784 -0.889724688 0.264200377 -1.512420493 0.814536292
[16] -1.133012345 -0.335727926 0.092907624 -1.475513500 -0.995488130
[21] -0.116911058 0.628159707 1.323660274 -0.953530128 -1.148372105
[26] 0.161143595 -1.101771100 1.659609358 0.949642859 -0.048529024
[31] 0.052984621 0.979178683 -0.172937517 0.965964579 0.325894775
[36] 0.291939578 -0.659800684 -0.447013635 -0.301769074 -1.183566391
[41] 0.326758608 -0.035458945 0.393125727 -1.021941629 -0.470227201
[46] -0.671596177 0.558094251 0.146207013 0.254394317 -1.093803864
[51] -1.894427715 0.122418411 0.535455649 0.729814740 0.388268667
[56] 0.523486420 -0.040346413 1.207316464 -1.359800810 0.451055018
[61] 2.105638088 0.856425949 -1.291122736 0.721172937 -1.001565380
[66] -2.258822372 -1.043105082 0.036311261 0.698170507 -0.776545322
[71] 1.223072483 -0.157258082 -1.155716413 -0.263374784 0.653627382
[76] 0.536337474 -1.480692243 -0.007882322 -1.804755067 0.587068986
[81] 1.665451536 0.552115867 1.634715867 -0.475141685 -1.454775150
[86] 0.722036127 0.784627159 0.029450789 1.235161663 -1.299080723
[91] 0.701172968 -0.803339192 1.322903779 0.077137211 0.858822517
[96] 1.890220233 -0.314787458 -0.603986164 1.365862633 0.480198443
> 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] -3.001611266 -0.538322088 -2.122552474 -0.495129261 -1.304838551
[6] 0.373878119 1.588671845 -0.266861795 0.226975833 0.337689000
[11] 2.481447784 -0.889724688 0.264200377 -1.512420493 0.814536292
[16] -1.133012345 -0.335727926 0.092907624 -1.475513500 -0.995488130
[21] -0.116911058 0.628159707 1.323660274 -0.953530128 -1.148372105
[26] 0.161143595 -1.101771100 1.659609358 0.949642859 -0.048529024
[31] 0.052984621 0.979178683 -0.172937517 0.965964579 0.325894775
[36] 0.291939578 -0.659800684 -0.447013635 -0.301769074 -1.183566391
[41] 0.326758608 -0.035458945 0.393125727 -1.021941629 -0.470227201
[46] -0.671596177 0.558094251 0.146207013 0.254394317 -1.093803864
[51] -1.894427715 0.122418411 0.535455649 0.729814740 0.388268667
[56] 0.523486420 -0.040346413 1.207316464 -1.359800810 0.451055018
[61] 2.105638088 0.856425949 -1.291122736 0.721172937 -1.001565380
[66] -2.258822372 -1.043105082 0.036311261 0.698170507 -0.776545322
[71] 1.223072483 -0.157258082 -1.155716413 -0.263374784 0.653627382
[76] 0.536337474 -1.480692243 -0.007882322 -1.804755067 0.587068986
[81] 1.665451536 0.552115867 1.634715867 -0.475141685 -1.454775150
[86] 0.722036127 0.784627159 0.029450789 1.235161663 -1.299080723
[91] 0.701172968 -0.803339192 1.322903779 0.077137211 0.858822517
[96] 1.890220233 -0.314787458 -0.603986164 1.365862633 0.480198443
> rowMin(tmp2)
[1] -3.001611266 -0.538322088 -2.122552474 -0.495129261 -1.304838551
[6] 0.373878119 1.588671845 -0.266861795 0.226975833 0.337689000
[11] 2.481447784 -0.889724688 0.264200377 -1.512420493 0.814536292
[16] -1.133012345 -0.335727926 0.092907624 -1.475513500 -0.995488130
[21] -0.116911058 0.628159707 1.323660274 -0.953530128 -1.148372105
[26] 0.161143595 -1.101771100 1.659609358 0.949642859 -0.048529024
[31] 0.052984621 0.979178683 -0.172937517 0.965964579 0.325894775
[36] 0.291939578 -0.659800684 -0.447013635 -0.301769074 -1.183566391
[41] 0.326758608 -0.035458945 0.393125727 -1.021941629 -0.470227201
[46] -0.671596177 0.558094251 0.146207013 0.254394317 -1.093803864
[51] -1.894427715 0.122418411 0.535455649 0.729814740 0.388268667
[56] 0.523486420 -0.040346413 1.207316464 -1.359800810 0.451055018
[61] 2.105638088 0.856425949 -1.291122736 0.721172937 -1.001565380
[66] -2.258822372 -1.043105082 0.036311261 0.698170507 -0.776545322
[71] 1.223072483 -0.157258082 -1.155716413 -0.263374784 0.653627382
[76] 0.536337474 -1.480692243 -0.007882322 -1.804755067 0.587068986
[81] 1.665451536 0.552115867 1.634715867 -0.475141685 -1.454775150
[86] 0.722036127 0.784627159 0.029450789 1.235161663 -1.299080723
[91] 0.701172968 -0.803339192 1.322903779 0.077137211 0.858822517
[96] 1.890220233 -0.314787458 -0.603986164 1.365862633 0.480198443
>
> colMeans(tmp2)
[1] -0.03092374
> colSums(tmp2)
[1] -3.092374
> colVars(tmp2)
[1] 1.069141
> colSd(tmp2)
[1] 1.033993
> colMax(tmp2)
[1] 2.481448
> colMin(tmp2)
[1] -3.001611
> colMedians(tmp2)
[1] 0.06506092
> colRanges(tmp2)
[,1]
[1,] -3.001611
[2,] 2.481448
>
> 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] 5.427659 -2.928907 4.399697 4.240260 1.426671 -1.121977 -3.677055
[8] -2.658794 -3.995169 -2.442185
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.40113786
[2,] 0.04053212
[3,] 0.58215716
[4,] 0.92794881
[5,] 2.73497618
>
> rowApply(tmp,sum)
[1] 0.5146842 1.4935544 -5.0777573 2.1235525 -3.1078542 -0.5562810
[7] -0.2289417 -2.4168850 -0.2345858 6.1607139
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 6 7 8 10 8 7 10 1 2 7
[2,] 9 2 4 4 5 5 2 7 5 2
[3,] 4 1 10 9 9 8 9 6 4 6
[4,] 7 9 7 3 10 2 3 9 8 10
[5,] 3 10 3 5 6 3 8 10 9 1
[6,] 8 4 6 8 2 9 4 5 10 4
[7,] 5 5 1 7 7 6 1 4 6 3
[8,] 1 8 5 6 4 4 6 3 3 8
[9,] 2 6 2 1 3 10 7 2 1 9
[10,] 10 3 9 2 1 1 5 8 7 5
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -0.59213755 -1.52141534 -2.84142953 0.84040602 -0.44178883 -0.74235445
[7] 5.65084285 -1.23163877 1.47775172 -0.84381476 -0.07393437 1.90898582
[13] -4.11668308 -2.03492794 1.62523449 -3.06696823 2.35707080 2.96064879
[19] -5.57146345 -0.60390848
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.1079986
[2,] -0.2168171
[3,] 0.4747141
[4,] 0.5212858
[5,] 0.7366782
>
> rowApply(tmp,sum)
[1] 6.0872937 -4.2386366 -0.9969002 -2.1640935 -5.5491878
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 9 15 8 17 2
[2,] 1 11 6 15 19
[3,] 2 6 18 9 3
[4,] 3 17 13 14 18
[5,] 16 5 4 19 6
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.4747141 -2.0092639 -1.1914670 -0.9496003 0.9169347 -0.1488995
[2,] 0.5212858 -0.1552352 -0.8918540 0.7950564 -0.9910702 -1.3584311
[3,] -0.2168171 -0.5880445 0.9677647 0.1526134 -0.8145910 0.7112881
[4,] 0.7366782 0.3091109 -0.3519355 0.1100931 1.2805081 -0.4638398
[5,] -2.1079986 0.9220174 -1.3739377 0.7322434 -0.8335704 0.5175278
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 1.2894863 0.8081477 1.140143539 -0.62097515 0.5937514 0.44253777
[2,] 0.8634964 -1.4429331 -0.141891262 -0.47125984 -0.6703857 0.60884181
[3,] -0.6026864 0.8693749 1.173758133 -0.38496233 0.6732934 0.05658152
[4,] 1.8572663 -0.7824957 -0.699916164 -0.05403141 -0.1064219 0.59726204
[5,] 2.2432802 -0.6837326 0.005657476 0.68741397 -0.5641717 0.20376268
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.08623631 0.52656225 2.01053411 0.5250566 1.19814402 0.6816291
[2,] -0.52074615 -0.04439177 0.45866883 -0.8216679 1.51083598 1.2410046
[3,] -1.03267180 -1.60578365 0.00463866 -2.6431259 0.10730929 1.2564125
[4,] -1.74721929 -0.79411455 -1.01930477 0.8714404 0.03449136 -0.5503832
[5,] -0.90228214 -0.11720022 0.17069766 -0.9986714 -0.49370985 0.3319858
[,19] [,20]
[1,] -0.3192799 0.6329014
[2,] -1.5945531 -1.1334071
[3,] 0.0750479 0.8436999
[4,] -1.2429089 -0.1483726
[5,] -2.4897694 -0.7987302
>
>
> 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 : 654 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 566 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.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 -0.3546574 1.212993 -0.4224439 0.1323328 -0.7402583 0.4725786 1.031519
col8 col9 col10 col11 col12 col13 col14
row1 0.9687638 -1.146249 -1.543324 -1.42959 -0.1164754 -0.6256014 1.847045
col15 col16 col17 col18 col19 col20
row1 -0.7617809 -0.771506 0.380853 -0.2060084 0.8684839 -0.6548266
> tmp[,"col10"]
col10
row1 -1.5433238
row2 -0.3069208
row3 1.7987025
row4 0.7961083
row5 -2.2572312
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -0.3546574 1.2129934 -0.4224439 0.1323328 -0.7402583 0.4725786 1.031519
row5 -0.4505005 -0.7416743 0.2535964 -0.1634782 -2.1351245 1.3512709 -1.354151
col8 col9 col10 col11 col12 col13 col14
row1 0.9687638 -1.146249 -1.543324 -1.4295904 -0.1164754 -0.6256014 1.8470445
row5 -1.1669585 1.069207 -2.257231 0.7647743 1.0212801 1.2652908 -0.1469169
col15 col16 col17 col18 col19 col20
row1 -0.7617809 -0.7715060 0.3808530 -0.2060084 0.8684839 -0.65482665
row5 -0.9215528 0.1692534 0.7376838 -0.7750824 -0.7853778 0.09234137
> tmp[,c("col6","col20")]
col6 col20
row1 0.4725786 -0.65482665
row2 0.3580753 0.21210537
row3 -0.2470755 0.35638083
row4 1.1939024 -1.05804655
row5 1.3512709 0.09234137
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 0.4725786 -0.65482665
row5 1.3512709 0.09234137
>
>
>
>
> 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.00126 49.24039 48.74994 50.20499 48.60803 105.8016 49.45065 50.66552
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.05988 48.37231 50.22301 50.67515 51.27443 51.19814 49.24868 49.16839
col17 col18 col19 col20
row1 49.20401 48.3311 50.73835 105.8426
> tmp[,"col10"]
col10
row1 48.37231
row2 28.34081
row3 28.85657
row4 30.51180
row5 50.45382
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 51.00126 49.24039 48.74994 50.20499 48.60803 105.8016 49.45065 50.66552
row5 51.08418 48.06302 50.61168 50.40452 49.62553 105.1075 50.80375 50.75151
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.05988 48.37231 50.22301 50.67515 51.27443 51.19814 49.24868 49.16839
row5 49.55082 50.45382 51.50938 50.42064 49.80314 49.07518 51.23349 49.00013
col17 col18 col19 col20
row1 49.20401 48.33110 50.73835 105.8426
row5 50.84862 50.62939 50.85565 104.1577
> tmp[,c("col6","col20")]
col6 col20
row1 105.80163 105.84260
row2 75.02588 76.80242
row3 74.82620 75.61457
row4 73.92044 74.16772
row5 105.10753 104.15766
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.8016 105.8426
row5 105.1075 104.1577
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.8016 105.8426
row5 105.1075 104.1577
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.5444428
[2,] -0.7731992
[3,] -0.4357753
[4,] -0.1657218
[5,] 0.1474416
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.3366457 -0.3771082
[2,] 1.4969182 0.6594585
[3,] -2.1476841 1.5106919
[4,] -0.3782065 -0.3401093
[5,] -1.4664869 0.8904611
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 1.05397094 -0.4124489
[2,] 0.28376697 1.1855330
[3,] -0.01440696 1.9337729
[4,] -0.37738765 0.8485306
[5,] -0.62670149 -0.3351586
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 1.053971
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 1.053971
[2,] 0.283767
>
>
>
> 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.8396969 1.249938 1.0253943 0.1455647 1.104074 -0.160606 -1.6353009
row1 0.1625429 -1.414791 0.2795145 -0.3554956 1.039534 -2.064675 0.7256801
[,8] [,9] [,10] [,11] [,12] [,13]
row3 -0.01416845 0.40910544 0.02159916 2.059532 0.722637 -0.8774175
row1 0.91093004 -0.02255326 -0.65130686 1.669493 1.447190 -2.0323589
[,14] [,15] [,16] [,17] [,18] [,19]
row3 1.4597475 0.8585199 -2.1113611 -1.3838137 -0.5711766 -0.2870072
row1 -0.1010444 -0.7551352 0.4837269 -0.6348737 1.4604119 -0.6440487
[,20]
row3 -0.199458
row1 0.484272
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.9884339 0.5816265 0.1000418 0.5441875 0.9009201 0.9512363 -1.638582
[,8] [,9] [,10]
row2 1.994123 -0.1078459 0.1178265
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -1.562467 0.8637764 -0.5401654 0.3371236 2.745026 1.312606 -0.05165418
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 1.311517 0.3213441 0.2725266 -0.2187888 1.468372 -1.299829 -0.653666
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.842898 -0.2839099 1.700647 1.31104 -0.9545685 -0.7216711
>
>
> 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: 0x57db819a99c0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31db9d458b3cca"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31db9d44dfc47b"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31db9d18ddf8a9"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31db9d572dfb53"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31db9d3c97f3ce"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31db9d4ca71169"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31db9d1f4e74cb"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31db9d567bdad4"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31db9d3192b4b0"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31db9d2dec2dd8"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31db9d7180a9a8"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31db9d16fdd888"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31db9d626c1678"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31db9d542886d4"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM31db9d47f605b4"
>
>
> ### 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: 0x57db83075000>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x57db83075000>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x57db83075000>
> rowMedians(tmp)
[1] -0.1484573763 -0.2555996535 0.0935863769 0.3477404335 -0.3991861177
[6] -0.1839059673 0.2005785929 -0.0839279655 0.0645264387 -0.4820834601
[11] 0.4580226404 -0.1306460735 -0.4118875988 0.0973456197 0.0870553368
[16] -0.0215272089 0.2474682162 -0.1511309498 -0.4653425798 -0.5110767144
[21] -0.0755029916 -0.1236424817 -0.0123774368 0.2433924494 -0.3708777152
[26] 0.2430022594 0.0405813612 -0.2423301931 0.2497949880 -0.0183705222
[31] 0.3411440877 0.4927130944 0.1191768026 0.4870758023 0.3771447268
[36] -0.1017158424 -0.0613293952 0.2157519372 0.4252786947 0.2583750388
[41] 0.0157214808 0.3024748401 -0.1466799661 -0.0294641213 -0.2183288633
[46] -0.3829004972 -0.0428637933 0.2738756017 -0.1241171544 -0.0880474839
[51] 0.1598180329 -0.0386077417 -1.2060515157 0.1264778058 0.0402910285
[56] 0.1200923250 0.4513966733 -0.0203760394 -0.5902171751 0.3205851513
[61] 0.0307797106 0.2033971382 -0.1077725364 -0.4506559194 0.0501535403
[66] 0.1581151650 -0.3491429564 -0.2306026296 0.1120756549 -0.0109498103
[71] 0.3277740116 0.4301326528 -0.1198389786 0.6062088424 -0.5325903717
[76] -0.0038332326 -0.2403503631 0.0520905497 0.1953879650 -0.0290018819
[81] -0.1506923842 -0.0036551873 -0.0946868355 0.2594293218 0.0819351008
[86] -0.2518367795 -0.3848604862 -0.2728012257 -0.1148062961 0.1665198478
[91] -0.2753153269 0.4235647193 -0.3350853104 0.5767896826 -0.5242472991
[96] -0.6202826236 -0.0547267566 0.1299386211 -0.1243340962 0.2004443695
[101] 0.0826572839 0.1546151198 -0.5161085272 -0.1128999515 0.1311158400
[106] -0.0367123527 0.1214006513 -0.0262602439 0.7351224160 -0.3814700041
[111] 0.1943564229 0.0249425085 -0.0434498105 -0.0247730149 -0.2407418995
[116] -0.0280929496 0.2282117772 -0.3464665163 -0.2200455459 0.0083750907
[121] 0.8141556602 -0.4260310455 -0.0084944195 -0.4712722113 -0.5755251697
[126] 0.7161983075 0.2706228337 0.2548115705 0.2028695795 0.1971921533
[131] 0.0788850874 0.0002892096 -0.7803283739 0.1087017171 0.0303305492
[136] 0.5349787467 0.3893554124 -0.3543054183 0.1838831364 -0.2664871776
[141] 0.1605806571 0.0404644485 0.0250319915 -0.4091019988 -0.0834221292
[146] -0.3794444792 0.2907654801 0.3527560910 -0.5297874763 -0.1778673093
[151] 0.0321774387 -0.1499720831 0.1722813828 -0.3542315389 -0.0569524990
[156] 0.0198475188 -0.5024857898 -0.7038396524 0.5157568988 -0.0130618909
[161] -0.0451092270 0.0533477897 0.3097244660 0.1339418119 -0.0708931098
[166] 0.2278451884 -0.2886112655 0.2152234987 -0.9565841738 0.5983197324
[171] 0.2864989352 0.1479212061 0.4625058216 -0.0004647594 0.1897425670
[176] -0.0534212112 -0.1245517441 -0.1298410169 0.3083899125 -0.4358416862
[181] 0.2052643568 -0.3398341335 0.1421403514 -0.1767731053 0.4318154873
[186] -0.4741034314 0.2012209638 0.1181313655 -0.2550056472 0.5042312784
[191] 0.1866780674 -0.4648477308 0.0199061938 -0.3519486988 -0.2160613701
[196] -0.4361253235 -1.1215966719 0.0572320041 0.0661479071 -0.4228351754
[201] 0.0205594031 0.4731547853 -0.4866863385 -0.3692870084 -0.0324936450
[206] 0.3601503227 -0.5752892222 0.0101194351 0.0716690044 0.0353643476
[211] -0.3151959572 0.3440574917 -0.2021457637 0.5747145189 0.4290357745
[216] -0.0014087287 -0.5201360721 -0.6486397948 0.1189590464 -0.3470204655
[221] 0.2678059374 -0.3140947443 -0.0219066482 0.0304516724 -0.3773570939
[226] -0.0014889375 -0.4573103743 0.1910200885 -0.0458257281 -0.6005786624
>
> proc.time()
user system elapsed
1.233 0.674 1.895
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: 0x5644a79c6370>
> .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: 0x5644a79c6370>
> .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: 0x5644a79c6370>
> .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: 0x5644a79c6370>
> 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: 0x5644a79ae1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5644a79ae1c0>
> .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: 0x5644a79ae1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5644a79ae1c0>
> .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: 0x5644a79ae1c0>
> 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: 0x5644a7c91120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5644a7c91120>
> .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: 0x5644a7c91120>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5644a7c91120>
> .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: 0x5644a7c91120>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5644a7c91120>
> .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: 0x5644a7c91120>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5644a7c91120>
> .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: 0x5644a7c91120>
> 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: 0x5644a69e1390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5644a69e1390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5644a69e1390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5644a69e1390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile31dc7f539c3226" "BufferedMatrixFile31dc7f5a242542"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile31dc7f539c3226" "BufferedMatrixFile31dc7f5a242542"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5644a68d83d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5644a68d83d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5644a68d83d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5644a68d83d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5644a68d83d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5644a68d83d0>
> .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: 0x5644a840dfa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5644a840dfa0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5644a840dfa0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5644a840dfa0>
> 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: 0x5644a6be5ff0>
> .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: 0x5644a6be5ff0>
> rm(P)
>
> proc.time()
user system elapsed
0.240 0.038 0.269
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.230 0.054 0.273