| Back to Build/check report for BioC 3.22: simplified long |
|
This page was generated on 2026-03-14 11:57 -0400 (Sat, 14 Mar 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" | 4892 |
| 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-03-13 21:39:48 -0400 (Fri, 13 Mar 2026) |
| EndedAt: 2026-03-13 21:40:12 -0400 (Fri, 13 Mar 2026) |
| EllapsedTime: 24.2 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.256 0.045 0.287
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] "Fri Mar 13 21:40:03 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri Mar 13 21:40:03 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: 0x5ad43eda0370>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Fri Mar 13 21:40:03 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Fri Mar 13 21:40:03 2026"
>
> ColMode(tmp2)
<pointer: 0x5ad43eda0370>
>
>
>
> ### 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,] 98.3188207 -0.4660678 0.5013039 -0.8650062
[2,] -1.6459447 -0.3894128 -1.0774231 1.7265505
[3,] -2.3443361 -0.9123457 0.2694856 -0.7830979
[4,] -0.3648591 0.8320625 -1.3981751 1.6240289
> 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,] 98.3188207 0.4660678 0.5013039 0.8650062
[2,] 1.6459447 0.3894128 1.0774231 1.7265505
[3,] 2.3443361 0.9123457 0.2694856 0.7830979
[4,] 0.3648591 0.8320625 1.3981751 1.6240289
> 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,] 9.9155847 0.6826916 0.7080282 0.9300571
[2,] 1.2829438 0.6240295 1.0379899 1.3139827
[3,] 1.5311225 0.9551679 0.5191200 0.8849282
[4,] 0.6040357 0.9121746 1.1824445 1.2743739
>
> 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,] 222.47467 32.29298 32.58159 35.16558
[2,] 39.47538 31.62971 36.45732 39.86638
[3,] 42.65556 35.46402 30.46069 34.63238
[4,] 31.40522 34.95381 38.22262 39.36777
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5ad43fd9c9b0>
> exp(tmp5)
<pointer: 0x5ad43fd9c9b0>
> log(tmp5,2)
<pointer: 0x5ad43fd9c9b0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 463.0519
> Min(tmp5)
[1] 53.43145
> mean(tmp5)
[1] 72.53224
> Sum(tmp5)
[1] 14506.45
> Var(tmp5)
[1] 836.4004
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.98769 70.80488 72.00291 72.79197 67.18095 70.48540 70.23413 73.16591
[9] 69.94940 68.71916
> rowSums(tmp5)
[1] 1799.754 1416.098 1440.058 1455.839 1343.619 1409.708 1404.683 1463.318
[9] 1398.988 1374.383
> rowVars(tmp5)
[1] 7784.79583 68.18577 87.36222 52.34354 96.80466 47.81584
[7] 56.84747 61.13970 74.16618 43.63401
> rowSd(tmp5)
[1] 88.231490 8.257467 9.346776 7.234884 9.838936 6.914900 7.539726
[8] 7.819188 8.611979 6.605605
> rowMax(tmp5)
[1] 463.05187 82.97664 89.78731 83.21465 89.77396 87.59380 82.95515
[8] 88.14943 87.76939 81.54309
> rowMin(tmp5)
[1] 57.52720 53.99630 53.43145 60.35013 55.15099 59.01601 57.79869 58.01761
[9] 58.23875 57.04097
>
> colMeans(tmp5)
[1] 111.73167 69.21229 71.65186 73.16628 69.03141 69.48141 73.52617
[8] 72.65695 69.88728 69.62907 67.68371 70.29683 74.05551 67.14098
[15] 76.79125 67.02489 67.37051 69.02397 68.06697 73.21580
> colSums(tmp5)
[1] 1117.3167 692.1229 716.5186 731.6628 690.3141 694.8141 735.2617
[8] 726.5695 698.8728 696.2907 676.8371 702.9683 740.5551 671.4098
[15] 767.9125 670.2489 673.7051 690.2397 680.6697 732.1580
> colVars(tmp5)
[1] 15303.25591 44.03260 48.19405 61.82690 94.21524 39.09086
[7] 28.30863 69.71064 64.54284 62.51441 54.08158 103.61652
[13] 95.32014 77.70865 71.71250 37.82717 62.83579 83.38555
[19] 103.25818 38.85478
> colSd(tmp5)
[1] 123.706329 6.635706 6.942193 7.863008 9.706454 6.252269
[7] 5.320585 8.349290 8.033856 7.906606 7.354018 10.179220
[13] 9.763203 8.815251 8.468324 6.150380 7.926903 9.131569
[19] 10.161603 6.233360
> colMax(tmp5)
[1] 463.05187 82.95515 80.35613 82.97664 87.59380 81.92980 81.05462
[8] 84.80782 81.54309 81.71488 77.84114 89.77396 89.78731 83.57308
[15] 88.14943 76.57738 79.58626 87.76939 94.96811 80.66810
> colMin(tmp5)
[1] 62.78453 60.38383 61.62989 56.86353 53.43145 59.53590 65.26957 57.59552
[9] 58.01761 57.52720 55.15099 58.37489 58.21125 57.29718 61.86824 59.38248
[17] 53.99630 59.01601 57.80186 58.20038
>
>
> ### 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] 89.98769 70.80488 72.00291 72.79197 67.18095 70.48540 70.23413 73.16591
[9] 69.94940 NA
> rowSums(tmp5)
[1] 1799.754 1416.098 1440.058 1455.839 1343.619 1409.708 1404.683 1463.318
[9] 1398.988 NA
> rowVars(tmp5)
[1] 7784.79583 68.18577 87.36222 52.34354 96.80466 47.81584
[7] 56.84747 61.13970 74.16618 39.15206
> rowSd(tmp5)
[1] 88.231490 8.257467 9.346776 7.234884 9.838936 6.914900 7.539726
[8] 7.819188 8.611979 6.257161
> rowMax(tmp5)
[1] 463.05187 82.97664 89.78731 83.21465 89.77396 87.59380 82.95515
[8] 88.14943 87.76939 NA
> rowMin(tmp5)
[1] 57.52720 53.99630 53.43145 60.35013 55.15099 59.01601 57.79869 58.01761
[9] 58.23875 NA
>
> colMeans(tmp5)
[1] 111.73167 69.21229 71.65186 73.16628 69.03141 69.48141 73.52617
[8] 72.65695 69.88728 69.62907 67.68371 70.29683 74.05551 67.14098
[15] 76.79125 67.02489 NA 69.02397 68.06697 73.21580
> colSums(tmp5)
[1] 1117.3167 692.1229 716.5186 731.6628 690.3141 694.8141 735.2617
[8] 726.5695 698.8728 696.2907 676.8371 702.9683 740.5551 671.4098
[15] 767.9125 670.2489 NA 690.2397 680.6697 732.1580
> colVars(tmp5)
[1] 15303.25591 44.03260 48.19405 61.82690 94.21524 39.09086
[7] 28.30863 69.71064 64.54284 62.51441 54.08158 103.61652
[13] 95.32014 77.70865 71.71250 37.82717 NA 83.38555
[19] 103.25818 38.85478
> colSd(tmp5)
[1] 123.706329 6.635706 6.942193 7.863008 9.706454 6.252269
[7] 5.320585 8.349290 8.033856 7.906606 7.354018 10.179220
[13] 9.763203 8.815251 8.468324 6.150380 NA 9.131569
[19] 10.161603 6.233360
> colMax(tmp5)
[1] 463.05187 82.95515 80.35613 82.97664 87.59380 81.92980 81.05462
[8] 84.80782 81.54309 81.71488 77.84114 89.77396 89.78731 83.57308
[15] 88.14943 76.57738 NA 87.76939 94.96811 80.66810
> colMin(tmp5)
[1] 62.78453 60.38383 61.62989 56.86353 53.43145 59.53590 65.26957 57.59552
[9] 58.01761 57.52720 55.15099 58.37489 58.21125 57.29718 61.86824 59.38248
[17] NA 59.01601 57.80186 58.20038
>
> Max(tmp5,na.rm=TRUE)
[1] 463.0519
> Min(tmp5,na.rm=TRUE)
[1] 53.43145
> mean(tmp5,na.rm=TRUE)
[1] 72.49679
> Sum(tmp5,na.rm=TRUE)
[1] 14426.86
> Var(tmp5,na.rm=TRUE)
[1] 840.3721
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.98769 70.80488 72.00291 72.79197 67.18095 70.48540 70.23413 73.16591
[9] 69.94940 68.14721
> rowSums(tmp5,na.rm=TRUE)
[1] 1799.754 1416.098 1440.058 1455.839 1343.619 1409.708 1404.683 1463.318
[9] 1398.988 1294.797
> rowVars(tmp5,na.rm=TRUE)
[1] 7784.79583 68.18577 87.36222 52.34354 96.80466 47.81584
[7] 56.84747 61.13970 74.16618 39.15206
> rowSd(tmp5,na.rm=TRUE)
[1] 88.231490 8.257467 9.346776 7.234884 9.838936 6.914900 7.539726
[8] 7.819188 8.611979 6.257161
> rowMax(tmp5,na.rm=TRUE)
[1] 463.05187 82.97664 89.78731 83.21465 89.77396 87.59380 82.95515
[8] 88.14943 87.76939 81.54309
> rowMin(tmp5,na.rm=TRUE)
[1] 57.52720 53.99630 53.43145 60.35013 55.15099 59.01601 57.79869 58.01761
[9] 58.23875 57.04097
>
> colMeans(tmp5,na.rm=TRUE)
[1] 111.73167 69.21229 71.65186 73.16628 69.03141 69.48141 73.52617
[8] 72.65695 69.88728 69.62907 67.68371 70.29683 74.05551 67.14098
[15] 76.79125 67.02489 66.01320 69.02397 68.06697 73.21580
> colSums(tmp5,na.rm=TRUE)
[1] 1117.3167 692.1229 716.5186 731.6628 690.3141 694.8141 735.2617
[8] 726.5695 698.8728 696.2907 676.8371 702.9683 740.5551 671.4098
[15] 767.9125 670.2489 594.1188 690.2397 680.6697 732.1580
> colVars(tmp5,na.rm=TRUE)
[1] 15303.25591 44.03260 48.19405 61.82690 94.21524 39.09086
[7] 28.30863 69.71064 64.54284 62.51441 54.08158 103.61652
[13] 95.32014 77.70865 71.71250 37.82717 49.96461 83.38555
[19] 103.25818 38.85478
> colSd(tmp5,na.rm=TRUE)
[1] 123.706329 6.635706 6.942193 7.863008 9.706454 6.252269
[7] 5.320585 8.349290 8.033856 7.906606 7.354018 10.179220
[13] 9.763203 8.815251 8.468324 6.150380 7.068565 9.131569
[19] 10.161603 6.233360
> colMax(tmp5,na.rm=TRUE)
[1] 463.05187 82.95515 80.35613 82.97664 87.59380 81.92980 81.05462
[8] 84.80782 81.54309 81.71488 77.84114 89.77396 89.78731 83.57308
[15] 88.14943 76.57738 75.73273 87.76939 94.96811 80.66810
> colMin(tmp5,na.rm=TRUE)
[1] 62.78453 60.38383 61.62989 56.86353 53.43145 59.53590 65.26957 57.59552
[9] 58.01761 57.52720 55.15099 58.37489 58.21125 57.29718 61.86824 59.38248
[17] 53.99630 59.01601 57.80186 58.20038
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.98769 70.80488 72.00291 72.79197 67.18095 70.48540 70.23413 73.16591
[9] 69.94940 NaN
> rowSums(tmp5,na.rm=TRUE)
[1] 1799.754 1416.098 1440.058 1455.839 1343.619 1409.708 1404.683 1463.318
[9] 1398.988 0.000
> rowVars(tmp5,na.rm=TRUE)
[1] 7784.79583 68.18577 87.36222 52.34354 96.80466 47.81584
[7] 56.84747 61.13970 74.16618 NA
> rowSd(tmp5,na.rm=TRUE)
[1] 88.231490 8.257467 9.346776 7.234884 9.838936 6.914900 7.539726
[8] 7.819188 8.611979 NA
> rowMax(tmp5,na.rm=TRUE)
[1] 463.05187 82.97664 89.78731 83.21465 89.77396 87.59380 82.95515
[8] 88.14943 87.76939 NA
> rowMin(tmp5,na.rm=TRUE)
[1] 57.52720 53.99630 53.43145 60.35013 55.15099 59.01601 57.79869 58.01761
[9] 58.23875 NA
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 115.97151 69.05238 72.76541 73.79930 70.36368 69.41274 73.84558
[8] 73.26457 68.59219 69.50843 66.90597 71.20863 74.51238 67.68912
[15] 78.44936 66.67425 NaN 70.11953 68.07651 72.89354
> colSums(tmp5,na.rm=TRUE)
[1] 1043.7436 621.4714 654.8887 664.1937 633.2731 624.7146 664.6102
[8] 659.3812 617.3297 625.5759 602.1538 640.8776 670.6114 609.2021
[15] 706.0442 600.0683 0.0000 631.0757 612.6886 656.0419
> colVars(tmp5,na.rm=TRUE)
[1] 17013.92957 49.24898 40.26831 65.04713 86.02400 43.92416
[7] 30.69944 74.27085 53.74156 70.16499 54.03696 107.21570
[13] 104.88699 84.04208 49.74654 41.17244 NA 80.30593
[19] 116.16443 42.54333
> colSd(tmp5,na.rm=TRUE)
[1] 130.437455 7.017761 6.345732 8.065180 9.274912 6.627531
[7] 5.540707 8.618054 7.330863 8.376454 7.350984 10.354501
[13] 10.241435 9.167447 7.053123 6.416576 NA 8.961358
[19] 10.777960 6.522525
> colMax(tmp5,na.rm=TRUE)
[1] 463.05187 82.95515 80.35613 82.97664 87.59380 81.92980 81.05462
[8] 84.80782 78.39792 81.71488 77.84114 89.77396 89.78731 83.57308
[15] 88.14943 76.57738 -Inf 87.76939 94.96811 80.66810
> colMin(tmp5,na.rm=TRUE)
[1] 62.78453 60.38383 63.39993 56.86353 53.43145 59.53590 65.26957 57.59552
[9] 58.01761 57.52720 55.15099 58.37489 58.21125 57.29718 64.51200 59.38248
[17] Inf 59.01601 57.80186 58.20038
>
>
>
>
> 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] 248.0127 183.0127 269.6126 212.0890 285.0766 200.4181 209.0642 232.1005
[9] 236.8703 247.6323
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 248.0127 183.0127 269.6126 212.0890 285.0766 200.4181 209.0642 232.1005
[9] 236.8703 247.6323
>
>
>
> 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] 1.136868e-13 1.136868e-13 0.000000e+00 -2.842171e-14 -9.947598e-14
[6] 2.842171e-14 0.000000e+00 1.136868e-13 1.136868e-13 8.526513e-14
[11] 0.000000e+00 0.000000e+00 -5.684342e-14 0.000000e+00 -1.705303e-13
[16] -2.842171e-13 1.705303e-13 -1.136868e-13 -1.705303e-13 2.842171e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
6 16
5 18
3 3
4 8
3 9
10 14
9 20
8 20
5 10
1 17
10 19
3 1
8 11
5 3
9 18
7 9
3 18
1 11
9 19
2 14
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.214233
> Min(tmp)
[1] -2.482124
> mean(tmp)
[1] 0.1523973
> Sum(tmp)
[1] 15.23973
> Var(tmp)
[1] 1.001295
>
> rowMeans(tmp)
[1] 0.1523973
> rowSums(tmp)
[1] 15.23973
> rowVars(tmp)
[1] 1.001295
> rowSd(tmp)
[1] 1.000647
> rowMax(tmp)
[1] 2.214233
> rowMin(tmp)
[1] -2.482124
>
> colMeans(tmp)
[1] 0.43316254 -0.47418419 0.71738021 -1.34716919 -0.37253958 0.43859529
[7] -0.24967456 1.92755778 0.60740273 -0.16096114 -0.28585137 0.01734831
[13] 0.56106141 -0.79620071 0.51761390 0.89167538 0.37993953 -0.75085076
[19] -1.51400196 0.35709101 -0.67439360 2.20403311 0.64253140 1.47079136
[25] -0.17161680 0.27407529 1.97361156 -0.77350906 -0.36621054 0.99255651
[31] 0.15713699 0.28565705 1.64234681 0.25383057 0.19478085 0.33324889
[37] 1.46343333 1.77346849 1.13703955 0.03731616 1.96797889 0.63994366
[43] -0.28535464 -0.63466127 1.15025587 0.60461675 1.09293192 0.20858492
[49] -0.14102886 1.73378300 -0.64215305 -0.38366233 1.10948588 -0.21909171
[55] -0.61155901 0.23424868 0.19976958 0.25170171 -1.91450214 0.21631334
[61] 0.86901265 0.03945031 0.39923974 0.73856090 -0.53422082 2.02080048
[67] 1.23731178 0.44531615 -0.16595968 -0.46949259 -0.08286314 -1.27517242
[73] -0.13693943 0.56558032 -0.35075673 -1.04982982 -1.40993203 2.21423284
[79] -1.70322030 -0.80507380 1.06687035 0.32268562 0.08003040 0.05197929
[85] -1.20719220 -1.92907509 -1.39107250 0.07420797 -0.82959672 2.08745333
[91] -1.55101483 1.27354001 0.68302100 0.93638070 -1.43303854 -0.32149075
[97] 0.22280152 0.10909384 -2.48212377 0.60510489
> colSums(tmp)
[1] 0.43316254 -0.47418419 0.71738021 -1.34716919 -0.37253958 0.43859529
[7] -0.24967456 1.92755778 0.60740273 -0.16096114 -0.28585137 0.01734831
[13] 0.56106141 -0.79620071 0.51761390 0.89167538 0.37993953 -0.75085076
[19] -1.51400196 0.35709101 -0.67439360 2.20403311 0.64253140 1.47079136
[25] -0.17161680 0.27407529 1.97361156 -0.77350906 -0.36621054 0.99255651
[31] 0.15713699 0.28565705 1.64234681 0.25383057 0.19478085 0.33324889
[37] 1.46343333 1.77346849 1.13703955 0.03731616 1.96797889 0.63994366
[43] -0.28535464 -0.63466127 1.15025587 0.60461675 1.09293192 0.20858492
[49] -0.14102886 1.73378300 -0.64215305 -0.38366233 1.10948588 -0.21909171
[55] -0.61155901 0.23424868 0.19976958 0.25170171 -1.91450214 0.21631334
[61] 0.86901265 0.03945031 0.39923974 0.73856090 -0.53422082 2.02080048
[67] 1.23731178 0.44531615 -0.16595968 -0.46949259 -0.08286314 -1.27517242
[73] -0.13693943 0.56558032 -0.35075673 -1.04982982 -1.40993203 2.21423284
[79] -1.70322030 -0.80507380 1.06687035 0.32268562 0.08003040 0.05197929
[85] -1.20719220 -1.92907509 -1.39107250 0.07420797 -0.82959672 2.08745333
[91] -1.55101483 1.27354001 0.68302100 0.93638070 -1.43303854 -0.32149075
[97] 0.22280152 0.10909384 -2.48212377 0.60510489
> 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.43316254 -0.47418419 0.71738021 -1.34716919 -0.37253958 0.43859529
[7] -0.24967456 1.92755778 0.60740273 -0.16096114 -0.28585137 0.01734831
[13] 0.56106141 -0.79620071 0.51761390 0.89167538 0.37993953 -0.75085076
[19] -1.51400196 0.35709101 -0.67439360 2.20403311 0.64253140 1.47079136
[25] -0.17161680 0.27407529 1.97361156 -0.77350906 -0.36621054 0.99255651
[31] 0.15713699 0.28565705 1.64234681 0.25383057 0.19478085 0.33324889
[37] 1.46343333 1.77346849 1.13703955 0.03731616 1.96797889 0.63994366
[43] -0.28535464 -0.63466127 1.15025587 0.60461675 1.09293192 0.20858492
[49] -0.14102886 1.73378300 -0.64215305 -0.38366233 1.10948588 -0.21909171
[55] -0.61155901 0.23424868 0.19976958 0.25170171 -1.91450214 0.21631334
[61] 0.86901265 0.03945031 0.39923974 0.73856090 -0.53422082 2.02080048
[67] 1.23731178 0.44531615 -0.16595968 -0.46949259 -0.08286314 -1.27517242
[73] -0.13693943 0.56558032 -0.35075673 -1.04982982 -1.40993203 2.21423284
[79] -1.70322030 -0.80507380 1.06687035 0.32268562 0.08003040 0.05197929
[85] -1.20719220 -1.92907509 -1.39107250 0.07420797 -0.82959672 2.08745333
[91] -1.55101483 1.27354001 0.68302100 0.93638070 -1.43303854 -0.32149075
[97] 0.22280152 0.10909384 -2.48212377 0.60510489
> colMin(tmp)
[1] 0.43316254 -0.47418419 0.71738021 -1.34716919 -0.37253958 0.43859529
[7] -0.24967456 1.92755778 0.60740273 -0.16096114 -0.28585137 0.01734831
[13] 0.56106141 -0.79620071 0.51761390 0.89167538 0.37993953 -0.75085076
[19] -1.51400196 0.35709101 -0.67439360 2.20403311 0.64253140 1.47079136
[25] -0.17161680 0.27407529 1.97361156 -0.77350906 -0.36621054 0.99255651
[31] 0.15713699 0.28565705 1.64234681 0.25383057 0.19478085 0.33324889
[37] 1.46343333 1.77346849 1.13703955 0.03731616 1.96797889 0.63994366
[43] -0.28535464 -0.63466127 1.15025587 0.60461675 1.09293192 0.20858492
[49] -0.14102886 1.73378300 -0.64215305 -0.38366233 1.10948588 -0.21909171
[55] -0.61155901 0.23424868 0.19976958 0.25170171 -1.91450214 0.21631334
[61] 0.86901265 0.03945031 0.39923974 0.73856090 -0.53422082 2.02080048
[67] 1.23731178 0.44531615 -0.16595968 -0.46949259 -0.08286314 -1.27517242
[73] -0.13693943 0.56558032 -0.35075673 -1.04982982 -1.40993203 2.21423284
[79] -1.70322030 -0.80507380 1.06687035 0.32268562 0.08003040 0.05197929
[85] -1.20719220 -1.92907509 -1.39107250 0.07420797 -0.82959672 2.08745333
[91] -1.55101483 1.27354001 0.68302100 0.93638070 -1.43303854 -0.32149075
[97] 0.22280152 0.10909384 -2.48212377 0.60510489
> colMedians(tmp)
[1] 0.43316254 -0.47418419 0.71738021 -1.34716919 -0.37253958 0.43859529
[7] -0.24967456 1.92755778 0.60740273 -0.16096114 -0.28585137 0.01734831
[13] 0.56106141 -0.79620071 0.51761390 0.89167538 0.37993953 -0.75085076
[19] -1.51400196 0.35709101 -0.67439360 2.20403311 0.64253140 1.47079136
[25] -0.17161680 0.27407529 1.97361156 -0.77350906 -0.36621054 0.99255651
[31] 0.15713699 0.28565705 1.64234681 0.25383057 0.19478085 0.33324889
[37] 1.46343333 1.77346849 1.13703955 0.03731616 1.96797889 0.63994366
[43] -0.28535464 -0.63466127 1.15025587 0.60461675 1.09293192 0.20858492
[49] -0.14102886 1.73378300 -0.64215305 -0.38366233 1.10948588 -0.21909171
[55] -0.61155901 0.23424868 0.19976958 0.25170171 -1.91450214 0.21631334
[61] 0.86901265 0.03945031 0.39923974 0.73856090 -0.53422082 2.02080048
[67] 1.23731178 0.44531615 -0.16595968 -0.46949259 -0.08286314 -1.27517242
[73] -0.13693943 0.56558032 -0.35075673 -1.04982982 -1.40993203 2.21423284
[79] -1.70322030 -0.80507380 1.06687035 0.32268562 0.08003040 0.05197929
[85] -1.20719220 -1.92907509 -1.39107250 0.07420797 -0.82959672 2.08745333
[91] -1.55101483 1.27354001 0.68302100 0.93638070 -1.43303854 -0.32149075
[97] 0.22280152 0.10909384 -2.48212377 0.60510489
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.4331625 -0.4741842 0.7173802 -1.347169 -0.3725396 0.4385953 -0.2496746
[2,] 0.4331625 -0.4741842 0.7173802 -1.347169 -0.3725396 0.4385953 -0.2496746
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 1.927558 0.6074027 -0.1609611 -0.2858514 0.01734831 0.5610614 -0.7962007
[2,] 1.927558 0.6074027 -0.1609611 -0.2858514 0.01734831 0.5610614 -0.7962007
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.5176139 0.8916754 0.3799395 -0.7508508 -1.514002 0.357091 -0.6743936
[2,] 0.5176139 0.8916754 0.3799395 -0.7508508 -1.514002 0.357091 -0.6743936
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 2.204033 0.6425314 1.470791 -0.1716168 0.2740753 1.973612 -0.7735091
[2,] 2.204033 0.6425314 1.470791 -0.1716168 0.2740753 1.973612 -0.7735091
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.3662105 0.9925565 0.157137 0.285657 1.642347 0.2538306 0.1947809
[2,] -0.3662105 0.9925565 0.157137 0.285657 1.642347 0.2538306 0.1947809
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.3332489 1.463433 1.773468 1.13704 0.03731616 1.967979 0.6399437
[2,] 0.3332489 1.463433 1.773468 1.13704 0.03731616 1.967979 0.6399437
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.2853546 -0.6346613 1.150256 0.6046168 1.092932 0.2085849 -0.1410289
[2,] -0.2853546 -0.6346613 1.150256 0.6046168 1.092932 0.2085849 -0.1410289
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 1.733783 -0.642153 -0.3836623 1.109486 -0.2190917 -0.611559 0.2342487
[2,] 1.733783 -0.642153 -0.3836623 1.109486 -0.2190917 -0.611559 0.2342487
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.1997696 0.2517017 -1.914502 0.2163133 0.8690127 0.03945031 0.3992397
[2,] 0.1997696 0.2517017 -1.914502 0.2163133 0.8690127 0.03945031 0.3992397
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.7385609 -0.5342208 2.0208 1.237312 0.4453162 -0.1659597 -0.4694926
[2,] 0.7385609 -0.5342208 2.0208 1.237312 0.4453162 -0.1659597 -0.4694926
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.08286314 -1.275172 -0.1369394 0.5655803 -0.3507567 -1.04983 -1.409932
[2,] -0.08286314 -1.275172 -0.1369394 0.5655803 -0.3507567 -1.04983 -1.409932
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 2.214233 -1.70322 -0.8050738 1.06687 0.3226856 0.0800304 0.05197929
[2,] 2.214233 -1.70322 -0.8050738 1.06687 0.3226856 0.0800304 0.05197929
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -1.207192 -1.929075 -1.391073 0.07420797 -0.8295967 2.087453 -1.551015
[2,] -1.207192 -1.929075 -1.391073 0.07420797 -0.8295967 2.087453 -1.551015
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 1.27354 0.683021 0.9363807 -1.433039 -0.3214907 0.2228015 0.1090938
[2,] 1.27354 0.683021 0.9363807 -1.433039 -0.3214907 0.2228015 0.1090938
[,99] [,100]
[1,] -2.482124 0.6051049
[2,] -2.482124 0.6051049
>
>
> Max(tmp2)
[1] 2.726067
> Min(tmp2)
[1] -1.787658
> mean(tmp2)
[1] 0.07493476
> Sum(tmp2)
[1] 7.493476
> Var(tmp2)
[1] 0.8562859
>
> rowMeans(tmp2)
[1] 0.321661270 -0.751793975 -0.207060782 -0.416770231 2.121471611
[6] -0.425444919 1.669183491 0.168766047 -1.787657866 0.950726748
[11] -1.060576527 -1.313183623 -0.444927206 1.384205967 -0.578817122
[16] 0.115527299 0.885209476 -0.779618491 -0.118333791 0.959106346
[21] 0.902346433 -1.346529459 -0.020520013 -1.379877731 0.019542415
[26] 0.588075472 0.064841374 -0.977575626 -0.070579172 -1.557619697
[31] -0.447812551 -0.861275645 0.368701212 0.422567021 1.774281073
[36] 0.599973519 -1.561055313 -0.232844916 0.814581779 -0.541226954
[41] 1.019888541 -1.239256909 -0.352965296 0.903029790 -0.629614703
[46] -0.137692026 -0.138463779 0.635821680 0.549174651 -1.476298626
[51] 1.746557732 1.497597101 0.560792697 -0.590913082 -0.222078538
[56] 0.673297377 -0.052732707 -0.954164978 -0.239836178 1.192663945
[61] 0.827791268 -0.280945509 0.084079656 -0.787169688 -0.406951299
[66] -1.001225048 -0.119089735 0.862526173 1.509729080 2.726066858
[71] 1.398469815 0.667615042 -0.950875341 0.323428883 -0.147863261
[76] -0.080800412 -0.452508678 -0.299710611 -0.664193222 -0.280081616
[81] 0.417644653 1.088430841 0.385129761 0.711427779 0.568750942
[86] 1.411477917 0.417563428 -0.296471151 -1.470258683 -0.120114902
[91] -0.244981474 1.055821474 1.885214217 -0.006390979 -0.242536750
[96] -0.427369263 -0.769081260 1.179163333 0.400237371 -1.372947005
> rowSums(tmp2)
[1] 0.321661270 -0.751793975 -0.207060782 -0.416770231 2.121471611
[6] -0.425444919 1.669183491 0.168766047 -1.787657866 0.950726748
[11] -1.060576527 -1.313183623 -0.444927206 1.384205967 -0.578817122
[16] 0.115527299 0.885209476 -0.779618491 -0.118333791 0.959106346
[21] 0.902346433 -1.346529459 -0.020520013 -1.379877731 0.019542415
[26] 0.588075472 0.064841374 -0.977575626 -0.070579172 -1.557619697
[31] -0.447812551 -0.861275645 0.368701212 0.422567021 1.774281073
[36] 0.599973519 -1.561055313 -0.232844916 0.814581779 -0.541226954
[41] 1.019888541 -1.239256909 -0.352965296 0.903029790 -0.629614703
[46] -0.137692026 -0.138463779 0.635821680 0.549174651 -1.476298626
[51] 1.746557732 1.497597101 0.560792697 -0.590913082 -0.222078538
[56] 0.673297377 -0.052732707 -0.954164978 -0.239836178 1.192663945
[61] 0.827791268 -0.280945509 0.084079656 -0.787169688 -0.406951299
[66] -1.001225048 -0.119089735 0.862526173 1.509729080 2.726066858
[71] 1.398469815 0.667615042 -0.950875341 0.323428883 -0.147863261
[76] -0.080800412 -0.452508678 -0.299710611 -0.664193222 -0.280081616
[81] 0.417644653 1.088430841 0.385129761 0.711427779 0.568750942
[86] 1.411477917 0.417563428 -0.296471151 -1.470258683 -0.120114902
[91] -0.244981474 1.055821474 1.885214217 -0.006390979 -0.242536750
[96] -0.427369263 -0.769081260 1.179163333 0.400237371 -1.372947005
> 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.321661270 -0.751793975 -0.207060782 -0.416770231 2.121471611
[6] -0.425444919 1.669183491 0.168766047 -1.787657866 0.950726748
[11] -1.060576527 -1.313183623 -0.444927206 1.384205967 -0.578817122
[16] 0.115527299 0.885209476 -0.779618491 -0.118333791 0.959106346
[21] 0.902346433 -1.346529459 -0.020520013 -1.379877731 0.019542415
[26] 0.588075472 0.064841374 -0.977575626 -0.070579172 -1.557619697
[31] -0.447812551 -0.861275645 0.368701212 0.422567021 1.774281073
[36] 0.599973519 -1.561055313 -0.232844916 0.814581779 -0.541226954
[41] 1.019888541 -1.239256909 -0.352965296 0.903029790 -0.629614703
[46] -0.137692026 -0.138463779 0.635821680 0.549174651 -1.476298626
[51] 1.746557732 1.497597101 0.560792697 -0.590913082 -0.222078538
[56] 0.673297377 -0.052732707 -0.954164978 -0.239836178 1.192663945
[61] 0.827791268 -0.280945509 0.084079656 -0.787169688 -0.406951299
[66] -1.001225048 -0.119089735 0.862526173 1.509729080 2.726066858
[71] 1.398469815 0.667615042 -0.950875341 0.323428883 -0.147863261
[76] -0.080800412 -0.452508678 -0.299710611 -0.664193222 -0.280081616
[81] 0.417644653 1.088430841 0.385129761 0.711427779 0.568750942
[86] 1.411477917 0.417563428 -0.296471151 -1.470258683 -0.120114902
[91] -0.244981474 1.055821474 1.885214217 -0.006390979 -0.242536750
[96] -0.427369263 -0.769081260 1.179163333 0.400237371 -1.372947005
> rowMin(tmp2)
[1] 0.321661270 -0.751793975 -0.207060782 -0.416770231 2.121471611
[6] -0.425444919 1.669183491 0.168766047 -1.787657866 0.950726748
[11] -1.060576527 -1.313183623 -0.444927206 1.384205967 -0.578817122
[16] 0.115527299 0.885209476 -0.779618491 -0.118333791 0.959106346
[21] 0.902346433 -1.346529459 -0.020520013 -1.379877731 0.019542415
[26] 0.588075472 0.064841374 -0.977575626 -0.070579172 -1.557619697
[31] -0.447812551 -0.861275645 0.368701212 0.422567021 1.774281073
[36] 0.599973519 -1.561055313 -0.232844916 0.814581779 -0.541226954
[41] 1.019888541 -1.239256909 -0.352965296 0.903029790 -0.629614703
[46] -0.137692026 -0.138463779 0.635821680 0.549174651 -1.476298626
[51] 1.746557732 1.497597101 0.560792697 -0.590913082 -0.222078538
[56] 0.673297377 -0.052732707 -0.954164978 -0.239836178 1.192663945
[61] 0.827791268 -0.280945509 0.084079656 -0.787169688 -0.406951299
[66] -1.001225048 -0.119089735 0.862526173 1.509729080 2.726066858
[71] 1.398469815 0.667615042 -0.950875341 0.323428883 -0.147863261
[76] -0.080800412 -0.452508678 -0.299710611 -0.664193222 -0.280081616
[81] 0.417644653 1.088430841 0.385129761 0.711427779 0.568750942
[86] 1.411477917 0.417563428 -0.296471151 -1.470258683 -0.120114902
[91] -0.244981474 1.055821474 1.885214217 -0.006390979 -0.242536750
[96] -0.427369263 -0.769081260 1.179163333 0.400237371 -1.372947005
>
> colMeans(tmp2)
[1] 0.07493476
> colSums(tmp2)
[1] 7.493476
> colVars(tmp2)
[1] 0.8562859
> colSd(tmp2)
[1] 0.9253572
> colMax(tmp2)
[1] 2.726067
> colMin(tmp2)
[1] -1.787658
> colMedians(tmp2)
[1] -0.07568979
> colRanges(tmp2)
[,1]
[1,] -1.787658
[2,] 2.726067
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] -0.5369615 2.8513102 4.8384005 -1.5218951 3.3402000 -0.6384629
[7] -2.4507699 2.4677933 0.2681192 4.6811294
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.84622156
[2,] -0.31718714
[3,] 0.06929008
[4,] 0.29608565
[5,] 1.07072872
>
> rowApply(tmp,sum)
[1] -4.3649665 0.5640141 0.3116953 -1.9948265 2.6550947 3.7941198
[7] 6.6515708 5.9530224 -0.6710996 0.4002383
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 8 6 5 7 3 8 3 5
[2,] 3 3 3 2 8 10 2 2 10 6
[3,] 4 6 5 7 4 4 10 7 8 8
[4,] 5 1 1 8 10 2 9 5 2 1
[5,] 9 10 6 9 9 9 1 6 7 2
[6,] 2 4 9 10 7 3 8 4 1 7
[7,] 6 8 4 3 3 1 6 3 5 3
[8,] 8 5 7 4 1 6 7 10 6 9
[9,] 7 9 10 1 2 5 5 1 4 4
[10,] 10 7 2 5 6 8 4 9 9 10
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.3068913 0.1377229 -2.9397466 -1.1155355 -1.2487741 -2.4891948
[7] -1.9717614 -1.5310946 6.6220160 3.3442656 -2.0963258 2.3323578
[13] 3.5298705 -5.0069971 3.4090754 -2.9989459 -1.6808863 0.1357926
[19] -0.9745864 1.3530136
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.29702602
[2,] -0.05208348
[3,] 0.10610464
[4,] 0.55079167
[5,] 0.99910450
>
> rowApply(tmp,sum)
[1] -0.7473788 -3.0174605 -1.4273246 3.4394765 -1.1301556
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 3 16 11 11 18
[2,] 18 8 6 15 3
[3,] 4 4 7 8 14
[4,] 16 13 2 7 13
[5,] 2 17 20 5 10
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -1.29702602 1.2894246 -1.15447534 0.866669449 -2.5678336 -0.90248278
[2,] 0.55079167 -0.4997724 -0.89578691 -0.059749942 0.7214364 -2.47153717
[3,] 0.10610464 -0.7455881 -0.59948988 -1.566973221 1.1242266 -0.02538044
[4,] -0.05208348 0.9586707 -0.34626539 -0.351795479 -0.3856052 1.17250061
[5,] 0.99910450 -0.8650118 0.05627095 -0.003686345 -0.1409984 -0.26229505
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.81533645 0.4852125 1.8219562 0.39950300 0.4657457 1.59526730
[2,] -0.07893206 -0.7987850 2.5167940 1.37029062 -1.7706915 0.14344397
[3,] -1.58052377 -0.9081376 -0.7675693 0.33016563 0.4279194 0.98122853
[4,] 0.69206420 0.2864701 2.3537293 1.33120865 -0.5363983 -0.37538859
[5,] -1.81970627 -0.5958545 0.6971057 -0.08690226 -0.6829012 -0.01219345
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 1.2219857 -3.19796297 0.3634416 -1.0307720 -0.05171006 -0.2988246
[2,] -0.3412335 -0.79657149 1.7861686 -0.4060257 0.07971544 -0.5325245
[3,] 1.0679964 0.17361904 -0.9949463 -0.2332769 -0.11145972 0.4671658
[4,] 1.4296659 -0.06736018 0.1947858 -0.7266614 -1.45381512 0.9673321
[5,] 0.1514560 -1.11872147 2.0596256 -0.6022099 -0.14361680 -0.4673562
[,19] [,20]
[1,] -0.3477109 0.7768769
[2,] -0.2186052 -1.3158858
[3,] 0.5906079 0.8369868
[4,] -1.4250389 -0.2265388
[5,] 0.4261608 1.2815745
>
>
> 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 : 653 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 0.7176014 -1.150031 -0.8565381 -1.173373 1.252462 2.36403 1.330142
col8 col9 col10 col11 col12 col13 col14
row1 1.016297 -0.9004967 0.375135 0.43283 0.4998849 2.432511 0.04561924
col15 col16 col17 col18 col19 col20
row1 -0.6463191 -1.300476 -0.429898 0.2824043 0.7871158 0.01961557
> tmp[,"col10"]
col10
row1 0.3751350
row2 0.2566768
row3 -0.4206727
row4 -0.4694170
row5 -1.6479528
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 0.7176014 -1.150031 -0.8565381 -1.173373 1.252462 2.364030 1.33014151
row5 -0.8951056 -1.252649 -1.1720620 1.774410 1.389241 1.036971 -0.06972212
col8 col9 col10 col11 col12 col13 col14
row1 1.016297 -0.9004967 0.375135 0.4328300 0.4998849 2.432511 0.04561924
row5 0.933159 -1.0105349 -1.647953 -0.4783195 -0.3792188 -1.261287 -0.89949142
col15 col16 col17 col18 col19 col20
row1 -0.6463191 -1.3004761 -0.429898 0.2824043 0.7871158 0.01961557
row5 -0.5910437 0.9990339 -1.206380 0.0629477 -2.3004524 -0.42242062
> tmp[,c("col6","col20")]
col6 col20
row1 2.364030222 0.01961557
row2 -0.003957995 1.13578505
row3 0.379321038 -0.16233405
row4 0.441837686 -0.47098931
row5 1.036970768 -0.42242062
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 2.364030 0.01961557
row5 1.036971 -0.42242062
>
>
>
>
> 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 49.86562 49.74354 52.49584 49.71096 52.47658 105.2069 49.01154 48.94311
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.83785 50.00699 50.01859 50.30397 49.44 51.66794 50.59144 49.10818
col17 col18 col19 col20
row1 50.09153 50.31816 49.28957 106.9904
> tmp[,"col10"]
col10
row1 50.00699
row2 29.11318
row3 29.30236
row4 29.17333
row5 50.47094
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.86562 49.74354 52.49584 49.71096 52.47658 105.2069 49.01154 48.94311
row5 49.91850 50.14214 51.01827 48.82493 48.66397 106.7037 50.40843 49.45814
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.83785 50.00699 50.01859 50.30397 49.44000 51.66794 50.59144 49.10818
row5 51.60275 50.47094 49.21978 52.29064 49.08154 50.65955 49.59429 49.33590
col17 col18 col19 col20
row1 50.09153 50.31816 49.28957 106.9904
row5 48.46969 50.10575 52.08600 105.1179
> tmp[,c("col6","col20")]
col6 col20
row1 105.20690 106.99042
row2 74.97095 73.39653
row3 72.91860 76.05849
row4 75.58968 74.40807
row5 106.70366 105.11794
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.2069 106.9904
row5 106.7037 105.1179
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.2069 106.9904
row5 106.7037 105.1179
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -2.1525220
[2,] 0.5465992
[3,] 0.6485073
[4,] 1.9276970
[5,] -1.1345381
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.2499342 1.5767594
[2,] 0.4141968 0.9948076
[3,] 1.1716970 -0.9834464
[4,] 0.2291607 -0.1186915
[5,] -0.3497291 0.6344688
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.78302848 -0.05637824
[2,] -0.00718615 -1.33267352
[3,] 0.87148832 0.92172156
[4,] 0.08953798 1.66181445
[5,] -2.20221284 0.92996597
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.7830285
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.78302848
[2,] -0.00718615
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row3 -0.4467127 0.9425092 2.113986 0.3803581 -1.224507 1.5945813
row1 1.2530578 -0.4979580 -1.754478 -1.6571831 1.732449 -0.2759508
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row3 -0.54911303 0.9004022 0.8993153 0.3455483 -1.445073 2.2289643 -0.7556151
row1 -0.09274997 1.2347865 -1.1036666 0.7369936 -0.691538 -0.3634396 0.8053026
[,14] [,15] [,16] [,17] [,18] [,19]
row3 -0.5659337 -0.2329894 0.07112945 -1.9980986 0.6898408 -0.4772209
row1 -0.5963167 -1.8947252 0.72480582 -0.6269486 1.2490376 0.6368853
[,20]
row3 -0.9420463
row1 2.3383427
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -1.409212 0.9255398 0.8298428 1.073534 -0.5164264 2.005989 -0.9341927
[,8] [,9] [,10]
row2 1.00355 -0.6685109 0.05667171
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.4698711 1.371213 -0.5802197 0.5783662 -0.7252792 -0.7195752 -1.656746
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 1.147455 -1.039891 -0.3924815 0.02530035 -0.4590051 1.094589 -0.007297922
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -1.718775 -0.3232131 0.3361544 -0.1748249 -0.3185619 0.5912636
>
>
> 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: 0x5ad4400a9cd0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3df5631d48030a"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3df563a2714a"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3df563721b724a"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3df56372e70a60"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3df5631ac1ee28"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3df56325ff8222"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3df5633c798bfa"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3df5632b7e61f6"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3df563242aee75"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3df5637ac9b237"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3df5632b950ebf"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3df56352d4b5d4"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3df5635e2a5a78"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3df5635da3aa9d"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM3df56357e3258c"
>
>
> ### 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: 0x5ad440081720>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5ad440081720>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5ad440081720>
> rowMedians(tmp)
[1] -0.396352969 -0.184452945 0.191172906 0.284943357 -0.202260354
[6] -0.171679859 -0.135990467 -0.125071552 0.381740509 0.089881371
[11] -0.201351039 0.096395070 -0.280089399 -0.127417204 0.302005122
[16] 0.039998898 -0.302674989 -0.709191781 0.184614577 0.236902076
[21] 0.230490825 0.146954901 0.038995757 0.635484393 -0.545475553
[26] -0.031978452 0.209735212 -0.212404864 0.180986126 0.083287217
[31] 0.545329066 -0.118239667 0.178986171 -0.279346701 0.172712652
[36] -0.131624720 -0.046920806 -0.089792484 0.241045731 0.217129763
[41] 0.037370513 -0.500952594 -0.418059387 0.406038008 0.451949480
[46] 0.450817936 -0.568800932 0.105610578 0.148121226 -0.206820663
[51] 0.221133698 -0.023514363 0.132310844 -0.109189799 -0.019548247
[56] -0.032019980 -0.090968858 0.680840594 0.190214377 0.007286230
[61] -0.224421526 0.051465829 -0.209264875 0.185300659 0.065656053
[66] 0.338369980 -0.130022373 0.145588545 -0.215727501 0.599862231
[71] -0.158195977 -0.586313835 -0.363345706 0.056628688 0.122226621
[76] -0.543132681 0.224161121 -0.367427925 -0.231679655 -0.508312665
[81] -0.099522363 0.142630452 -0.904283628 0.027890460 0.432499523
[86] -0.167889374 0.137497923 -0.569756149 0.389432963 -0.319139700
[91] -0.222930224 0.044743106 -0.106441540 -0.317738036 0.320952134
[96] -0.163052684 -0.290096469 -0.120204152 -0.310517051 0.041641757
[101] -0.436345038 0.384753497 -0.160740953 0.142706915 -0.032633549
[106] -0.124460488 -0.070649948 -0.272835092 0.434638997 0.406075715
[111] 0.252483353 0.251888141 -0.086646396 -0.112003918 0.048183473
[116] 0.153533622 0.545811253 -0.208616865 -0.164496149 0.247743419
[121] 0.138007582 0.075931103 -0.355775951 0.363865402 0.319998788
[126] -0.555372384 -0.088794240 -0.268171141 0.550787649 -0.183149752
[131] 0.089696426 0.118956802 0.558219637 -0.106605506 -0.205025319
[136] 0.454497628 0.310818233 0.033234915 0.306686084 -0.328392800
[141] 0.414785929 0.035008935 -0.394034011 -0.373057753 0.131145222
[146] -0.185178184 -0.487759956 -0.221871378 -0.229495477 -0.133802813
[151] -0.165022233 -0.066520449 0.113792600 0.264934798 -0.056068022
[156] -0.083106466 0.188649143 -0.076177594 -0.350494282 0.347255404
[161] 0.189696264 0.042552735 -0.270461017 -0.500219928 0.588019714
[166] -0.169524052 0.216853604 -0.095448580 -0.041224761 -0.222264801
[171] -0.235707548 -0.363526163 -0.382387859 -0.303231133 0.376095891
[176] -0.025812877 -0.265574723 0.100689273 0.429178963 -0.580830999
[181] 0.260141763 0.279615361 0.137557562 0.090366176 -0.053537427
[186] 0.138819063 0.032834084 0.191697407 0.128941130 -0.593689571
[191] 0.007034139 -0.265096208 -0.175515399 0.083091661 -0.504407142
[196] 0.516237326 0.157254248 0.275864942 -0.220886607 0.221548480
[201] 0.131839250 0.046342358 -0.469643343 -0.310248789 -0.482191769
[206] -1.006551042 -0.296991305 -0.392714165 -0.421218783 0.828042644
[211] -0.283472417 -0.711607717 -0.160666155 -0.488679050 0.594918937
[216] -0.220881134 -0.003639111 0.439351281 0.048066990 0.077736450
[221] 0.208348436 -0.233965299 -0.123664759 -0.447195671 0.448786482
[226] 0.042818507 -0.074425653 -0.674932068 -0.310152525 -0.218167233
>
> proc.time()
user system elapsed
1.217 0.664 1.870
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: 0x5937c64a4370>
> .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: 0x5937c64a4370>
> .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: 0x5937c64a4370>
> .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: 0x5937c64a4370>
> 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: 0x5937c648c1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5937c648c1c0>
> .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: 0x5937c648c1c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5937c648c1c0>
> .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: 0x5937c648c1c0>
> 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: 0x5937c676f120>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5937c676f120>
> .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: 0x5937c676f120>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5937c676f120>
> .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: 0x5937c676f120>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5937c676f120>
> .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: 0x5937c676f120>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5937c676f120>
> .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: 0x5937c676f120>
> 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: 0x5937c54bf390>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5937c54bf390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5937c54bf390>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5937c54bf390>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3df6ba10c43be5" "BufferedMatrixFile3df6ba3a381d1d"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3df6ba10c43be5" "BufferedMatrixFile3df6ba3a381d1d"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5937c53b63d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5937c53b63d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5937c53b63d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5937c53b63d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5937c53b63d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5937c53b63d0>
> .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: 0x5937c6eebfa0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5937c6eebfa0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5937c6eebfa0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5937c6eebfa0>
> 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: 0x5937c56c3ff0>
> .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: 0x5937c56c3ff0>
> rm(P)
>
> proc.time()
user system elapsed
0.238 0.049 0.274
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.247 0.041 0.274