| Back to Build/check report for BioC 3.24: simplified long |
|
This page was generated on 2026-04-23 11:32 -0400 (Thu, 23 Apr 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.4 LTS) | x86_64 | 4.6.0 RC (2026-04-17 r89917) -- "Because it was There" | 4796 |
| 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 249/2351 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.4 LTS) / x86_64 | OK | OK | OK | |||||||||
| See other builds for BufferedMatrix in R Universe. | ||||||||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.75.0 |
| Command: /home/biocbuild/bbs-3.24-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.24-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz |
| StartedAt: 2026-04-22 21:44:38 -0400 (Wed, 22 Apr 2026) |
| EndedAt: 2026-04-22 21:45:03 -0400 (Wed, 22 Apr 2026) |
| EllapsedTime: 25.2 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.24-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.24-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.6.0 RC (2026-04-17 r89917)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
* running under: Ubuntu 24.04.4 LTS
* using session charset: UTF-8
* current time: 2026-04-23 01:44:39 UTC
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE
Status: 1 NOTE
See
‘/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.24-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.24-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.24-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.24-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.24-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.24-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.24-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.24-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.24-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.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.246 0.044 0.280
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.24-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 480233 25.7 1053308 56.3 637571 34.1
Vcells 887253 6.8 8388608 64.0 2083896 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] "Wed Apr 22 21:44:54 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] "Wed Apr 22 21:44:55 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: 0x5ab0fa51b520>
>
>
>
> 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] "Wed Apr 22 21:44:55 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] "Wed Apr 22 21:44:55 2026"
>
> ColMode(tmp2)
<pointer: 0x5ab0fa51b520>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.9222851 -0.5686337 -0.1249770 -0.0864725
[2,] -0.5756838 0.7931845 0.8388004 -0.7798273
[3,] 0.6852311 -0.8861747 1.7008137 0.9200425
[4,] -1.2422472 -1.2971630 0.9537062 0.6552379
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 100.9222851 0.5686337 0.1249770 0.0864725
[2,] 0.5756838 0.7931845 0.8388004 0.7798273
[3,] 0.6852311 0.8861747 1.7008137 0.9200425
[4,] 1.2422472 1.2971630 0.9537062 0.6552379
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-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.0460084 0.7540781 0.3535208 0.2940621
[2,] 0.7587383 0.8906091 0.9158605 0.8830783
[3,] 0.8277869 0.9413685 1.3041525 0.9591885
[4,] 1.1145615 1.1389306 0.9765788 0.8094677
>
> 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.24-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.38237 33.10941 28.66019 28.02709
[2,] 33.16307 34.69928 34.99741 34.61061
[3,] 33.96310 35.29986 39.74234 35.51193
[4,] 37.38786 37.68647 35.71949 33.74991
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5ab0fbd149d0>
> exp(tmp5)
<pointer: 0x5ab0fbd149d0>
> log(tmp5,2)
<pointer: 0x5ab0fbd149d0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.1852
> Min(tmp5)
[1] 53.84873
> mean(tmp5)
[1] 71.77986
> Sum(tmp5)
[1] 14355.97
> Var(tmp5)
[1] 871.2556
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.06800 69.18624 71.93606 67.17428 68.99477 70.46126 70.90617 68.02516
[9] 70.13093 71.91574
> rowSums(tmp5)
[1] 1781.360 1383.725 1438.721 1343.486 1379.895 1409.225 1418.123 1360.503
[9] 1402.619 1438.315
> rowVars(tmp5)
[1] 8140.33687 64.06085 113.29094 64.21451 55.50155 84.86804
[7] 54.60732 76.79625 25.09058 73.92486
> rowSd(tmp5)
[1] 90.223815 8.003802 10.643822 8.013396 7.449936 9.212385 7.389677
[8] 8.763347 5.009050 8.597957
> rowMax(tmp5)
[1] 471.18524 78.79297 90.60454 78.43945 84.57547 87.62126 87.65448
[8] 89.40371 78.48257 87.07072
> rowMin(tmp5)
[1] 58.33472 54.40079 53.84873 54.28554 54.70494 58.97488 59.47421 55.97433
[9] 60.25473 58.34714
>
> colMeans(tmp5)
[1] 109.78099 69.10367 72.82820 70.07206 70.95900 67.78485 68.36542
[8] 68.60388 73.54886 66.44879 67.58117 65.87877 75.67543 69.47874
[15] 70.63158 66.65513 69.02414 73.57682 73.73927 65.86046
> colSums(tmp5)
[1] 1097.8099 691.0367 728.2820 700.7206 709.5900 677.8485 683.6542
[8] 686.0388 735.4886 664.4879 675.8117 658.7877 756.7543 694.7874
[15] 706.3158 666.5513 690.2414 735.7682 737.3927 658.6046
> colVars(tmp5)
[1] 16165.83544 72.08689 70.78946 43.20527 63.40597 49.36040
[7] 42.02709 87.78858 96.62961 39.40544 73.47632 72.14846
[13] 68.58900 54.90809 75.19580 67.92650 71.42682 83.90456
[19] 50.50017 54.26642
> colSd(tmp5)
[1] 127.144939 8.490400 8.413647 6.573072 7.962787 7.025696
[7] 6.482831 9.369556 9.830036 6.277375 8.571833 8.494025
[13] 8.281848 7.409999 8.671551 8.241753 8.451439 9.159943
[19] 7.106347 7.366574
> colMax(tmp5)
[1] 471.18524 78.43945 82.87739 82.96879 85.81199 75.91688 76.39950
[8] 87.65448 90.60454 78.29519 78.79297 81.01317 88.19418 78.16500
[15] 88.36059 80.31478 79.91456 89.40371 87.62126 79.71131
> colMin(tmp5)
[1] 56.38935 57.13509 59.65242 58.33472 58.68088 54.40079 59.47421 54.28554
[9] 61.52029 59.18053 55.46048 54.70494 62.68283 59.33480 55.97433 55.82056
[17] 53.84873 60.14123 63.64173 59.50772
>
>
> ### 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.06800 69.18624 71.93606 67.17428 68.99477 NA 70.90617 68.02516
[9] 70.13093 71.91574
> rowSums(tmp5)
[1] 1781.360 1383.725 1438.721 1343.486 1379.895 NA 1418.123 1360.503
[9] 1402.619 1438.315
> rowVars(tmp5)
[1] 8140.33687 64.06085 113.29094 64.21451 55.50155 86.81673
[7] 54.60732 76.79625 25.09058 73.92486
> rowSd(tmp5)
[1] 90.223815 8.003802 10.643822 8.013396 7.449936 9.317550 7.389677
[8] 8.763347 5.009050 8.597957
> rowMax(tmp5)
[1] 471.18524 78.79297 90.60454 78.43945 84.57547 NA 87.65448
[8] 89.40371 78.48257 87.07072
> rowMin(tmp5)
[1] 58.33472 54.40079 53.84873 54.28554 54.70494 NA 59.47421 55.97433
[9] 60.25473 58.34714
>
> colMeans(tmp5)
[1] 109.78099 69.10367 72.82820 70.07206 70.95900 67.78485 68.36542
[8] 68.60388 73.54886 66.44879 67.58117 65.87877 75.67543 NA
[15] 70.63158 66.65513 69.02414 73.57682 73.73927 65.86046
> colSums(tmp5)
[1] 1097.8099 691.0367 728.2820 700.7206 709.5900 677.8485 683.6542
[8] 686.0388 735.4886 664.4879 675.8117 658.7877 756.7543 NA
[15] 706.3158 666.5513 690.2414 735.7682 737.3927 658.6046
> colVars(tmp5)
[1] 16165.83544 72.08689 70.78946 43.20527 63.40597 49.36040
[7] 42.02709 87.78858 96.62961 39.40544 73.47632 72.14846
[13] 68.58900 NA 75.19580 67.92650 71.42682 83.90456
[19] 50.50017 54.26642
> colSd(tmp5)
[1] 127.144939 8.490400 8.413647 6.573072 7.962787 7.025696
[7] 6.482831 9.369556 9.830036 6.277375 8.571833 8.494025
[13] 8.281848 NA 8.671551 8.241753 8.451439 9.159943
[19] 7.106347 7.366574
> colMax(tmp5)
[1] 471.18524 78.43945 82.87739 82.96879 85.81199 75.91688 76.39950
[8] 87.65448 90.60454 78.29519 78.79297 81.01317 88.19418 NA
[15] 88.36059 80.31478 79.91456 89.40371 87.62126 79.71131
> colMin(tmp5)
[1] 56.38935 57.13509 59.65242 58.33472 58.68088 54.40079 59.47421 54.28554
[9] 61.52029 59.18053 55.46048 54.70494 62.68283 NA 55.97433 55.82056
[17] 53.84873 60.14123 63.64173 59.50772
>
> Max(tmp5,na.rm=TRUE)
[1] 471.1852
> Min(tmp5,na.rm=TRUE)
[1] 53.84873
> mean(tmp5,na.rm=TRUE)
[1] 71.75193
> Sum(tmp5,na.rm=TRUE)
[1] 14278.63
> Var(tmp5,na.rm=TRUE)
[1] 875.499
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.06800 69.18624 71.93606 67.17428 68.99477 70.09928 70.90617 68.02516
[9] 70.13093 71.91574
> rowSums(tmp5,na.rm=TRUE)
[1] 1781.360 1383.725 1438.721 1343.486 1379.895 1331.886 1418.123 1360.503
[9] 1402.619 1438.315
> rowVars(tmp5,na.rm=TRUE)
[1] 8140.33687 64.06085 113.29094 64.21451 55.50155 86.81673
[7] 54.60732 76.79625 25.09058 73.92486
> rowSd(tmp5,na.rm=TRUE)
[1] 90.223815 8.003802 10.643822 8.013396 7.449936 9.317550 7.389677
[8] 8.763347 5.009050 8.597957
> rowMax(tmp5,na.rm=TRUE)
[1] 471.18524 78.79297 90.60454 78.43945 84.57547 87.62126 87.65448
[8] 89.40371 78.48257 87.07072
> rowMin(tmp5,na.rm=TRUE)
[1] 58.33472 54.40079 53.84873 54.28554 54.70494 58.97488 59.47421 55.97433
[9] 60.25473 58.34714
>
> colMeans(tmp5,na.rm=TRUE)
[1] 109.78099 69.10367 72.82820 70.07206 70.95900 67.78485 68.36542
[8] 68.60388 73.54886 66.44879 67.58117 65.87877 75.67543 68.60539
[15] 70.63158 66.65513 69.02414 73.57682 73.73927 65.86046
> colSums(tmp5,na.rm=TRUE)
[1] 1097.8099 691.0367 728.2820 700.7206 709.5900 677.8485 683.6542
[8] 686.0388 735.4886 664.4879 675.8117 658.7877 756.7543 617.4485
[15] 706.3158 666.5513 690.2414 735.7682 737.3927 658.6046
> colVars(tmp5,na.rm=TRUE)
[1] 16165.83544 72.08689 70.78946 43.20527 63.40597 49.36040
[7] 42.02709 87.78858 96.62961 39.40544 73.47632 72.14846
[13] 68.58900 53.19074 75.19580 67.92650 71.42682 83.90456
[19] 50.50017 54.26642
> colSd(tmp5,na.rm=TRUE)
[1] 127.144939 8.490400 8.413647 6.573072 7.962787 7.025696
[7] 6.482831 9.369556 9.830036 6.277375 8.571833 8.494025
[13] 8.281848 7.293198 8.671551 8.241753 8.451439 9.159943
[19] 7.106347 7.366574
> colMax(tmp5,na.rm=TRUE)
[1] 471.18524 78.43945 82.87739 82.96879 85.81199 75.91688 76.39950
[8] 87.65448 90.60454 78.29519 78.79297 81.01317 88.19418 78.16500
[15] 88.36059 80.31478 79.91456 89.40371 87.62126 79.71131
> colMin(tmp5,na.rm=TRUE)
[1] 56.38935 57.13509 59.65242 58.33472 58.68088 54.40079 59.47421 54.28554
[9] 61.52029 59.18053 55.46048 54.70494 62.68283 59.33480 55.97433 55.82056
[17] 53.84873 60.14123 63.64173 59.50772
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.06800 69.18624 71.93606 67.17428 68.99477 NaN 70.90617 68.02516
[9] 70.13093 71.91574
> rowSums(tmp5,na.rm=TRUE)
[1] 1781.360 1383.725 1438.721 1343.486 1379.895 0.000 1418.123 1360.503
[9] 1402.619 1438.315
> rowVars(tmp5,na.rm=TRUE)
[1] 8140.33687 64.06085 113.29094 64.21451 55.50155 NA
[7] 54.60732 76.79625 25.09058 73.92486
> rowSd(tmp5,na.rm=TRUE)
[1] 90.223815 8.003802 10.643822 8.013396 7.449936 NA 7.389677
[8] 8.763347 5.009050 8.597957
> rowMax(tmp5,na.rm=TRUE)
[1] 471.18524 78.79297 90.60454 78.43945 84.57547 NA 87.65448
[8] 89.40371 78.48257 87.07072
> rowMin(tmp5,na.rm=TRUE)
[1] 58.33472 54.40079 53.84873 54.28554 54.70494 NA 59.47421 55.97433
[9] 60.25473 58.34714
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 115.08756 70.22909 72.29980 70.60729 70.97086 68.74267 68.34804
[8] 68.36139 72.04355 65.78989 68.47154 65.85846 74.79858 NaN
[15] 69.94603 67.10656 69.45029 73.18676 72.19683 66.42690
> colSums(tmp5,na.rm=TRUE)
[1] 1035.7880 632.0618 650.6982 635.4656 638.7378 618.6840 615.1324
[8] 615.2525 648.3920 592.1090 616.2439 592.7261 673.1872 0.0000
[15] 629.5143 603.9590 625.0526 658.6808 649.7715 597.8421
> colVars(tmp5,na.rm=TRUE)
[1] 17869.76906 66.84882 76.49698 45.38321 71.33014 45.20964
[7] 47.27708 98.10063 83.21627 39.44695 73.74227 81.16237
[13] 68.51277 NA 79.30798 74.12476 78.31207 92.68101
[19] 30.04746 57.44002
> colSd(tmp5,na.rm=TRUE)
[1] 133.677856 8.176113 8.746255 6.736706 8.445717 6.723812
[7] 6.875833 9.904576 9.122295 6.280680 8.587332 9.009016
[13] 8.277244 NA 8.905503 8.609574 8.849410 9.627098
[19] 5.481556 7.578920
> colMax(tmp5,na.rm=TRUE)
[1] 471.18524 78.43945 82.87739 82.96879 85.81199 75.91688 76.39950
[8] 87.65448 90.60454 78.29519 78.79297 81.01317 88.19418 -Inf
[15] 88.36059 80.31478 79.91456 89.40371 81.43288 79.71131
> colMin(tmp5,na.rm=TRUE)
[1] 56.38935 57.13509 59.65242 58.33472 58.68088 54.40079 59.47421 54.28554
[9] 61.52029 59.18053 55.46048 54.70494 62.68283 Inf 55.97433 55.82056
[17] 53.84873 60.14123 63.64173 59.50772
>
>
>
>
> 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] 384.9895 140.4615 377.0008 249.8051 186.6277 148.6515 312.1503 324.4643
[9] 184.0957 245.6146
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 384.9895 140.4615 377.0008 249.8051 186.6277 148.6515 312.1503 324.4643
[9] 184.0957 245.6146
>
>
>
> 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] 8.526513e-14 -2.842171e-14 2.273737e-13 3.410605e-13 -9.947598e-14
[6] 7.105427e-14 2.842171e-14 8.526513e-14 5.684342e-14 1.136868e-13
[11] 8.526513e-14 -1.421085e-13 -5.684342e-14 0.000000e+00 -5.684342e-14
[16] -5.684342e-14 -2.842171e-14 0.000000e+00 -4.263256e-14 -1.421085e-13
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
3 5
3 16
6 17
2 4
7 20
2 9
7 5
7 3
10 19
10 17
6 3
7 4
5 20
1 17
4 9
5 17
5 9
1 8
5 8
2 2
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.381596
> Min(tmp)
[1] -2.368605
> mean(tmp)
[1] 0.002179943
> Sum(tmp)
[1] 0.2179943
> Var(tmp)
[1] 0.8737891
>
> rowMeans(tmp)
[1] 0.002179943
> rowSums(tmp)
[1] 0.2179943
> rowVars(tmp)
[1] 0.8737891
> rowSd(tmp)
[1] 0.9347669
> rowMax(tmp)
[1] 2.381596
> rowMin(tmp)
[1] -2.368605
>
> colMeans(tmp)
[1] -1.460102247 -0.046702179 0.455681516 -0.564367828 0.055234334
[6] 0.209676401 1.921671523 0.081149065 -0.263351472 2.119239576
[11] 0.396380827 -0.412942358 -0.988268709 -0.856935638 2.381596136
[16] -1.053827555 0.748901008 -0.956712401 1.228060732 -1.092507548
[21] -1.548802326 -0.640045042 0.700134071 -0.107163843 -0.469586866
[26] 0.546461600 1.845329648 -0.002123846 -0.351473109 0.528159218
[31] -0.069614238 -0.088073949 -1.016740124 -0.376849844 -0.965843173
[36] 0.945828995 0.525867700 0.092906937 0.745162231 0.182363181
[41] -0.416284196 1.358576814 -0.004099709 0.998599547 0.859369573
[46] 1.441110354 0.354924517 0.137248876 0.095845695 -0.028298478
[51] 0.101710376 1.473944562 -0.723807622 1.052975740 -0.252704208
[56] 1.176040222 -1.254388263 -0.021453871 -0.966362094 -0.341721729
[61] 2.095180054 -0.965686553 0.446818887 -2.368604638 -0.886596253
[66] -0.381073225 0.807133157 -0.103766058 -0.252562200 0.167798098
[71] -0.033800856 -1.355521907 0.494448776 1.033512099 -0.794901768
[76] 0.759885915 -1.055640817 -1.134050998 -0.655824810 0.490227433
[81] -0.033963228 -0.960394073 1.095277650 -1.054784465 -0.513341454
[86] -0.574448313 -0.925905192 0.278673480 1.116308951 0.659457531
[91] -1.127028052 0.232871589 -1.645300120 0.558419293 -1.397390029
[96] -0.833799256 1.629318150 0.009151313 -0.642608010 0.621507700
> colSums(tmp)
[1] -1.460102247 -0.046702179 0.455681516 -0.564367828 0.055234334
[6] 0.209676401 1.921671523 0.081149065 -0.263351472 2.119239576
[11] 0.396380827 -0.412942358 -0.988268709 -0.856935638 2.381596136
[16] -1.053827555 0.748901008 -0.956712401 1.228060732 -1.092507548
[21] -1.548802326 -0.640045042 0.700134071 -0.107163843 -0.469586866
[26] 0.546461600 1.845329648 -0.002123846 -0.351473109 0.528159218
[31] -0.069614238 -0.088073949 -1.016740124 -0.376849844 -0.965843173
[36] 0.945828995 0.525867700 0.092906937 0.745162231 0.182363181
[41] -0.416284196 1.358576814 -0.004099709 0.998599547 0.859369573
[46] 1.441110354 0.354924517 0.137248876 0.095845695 -0.028298478
[51] 0.101710376 1.473944562 -0.723807622 1.052975740 -0.252704208
[56] 1.176040222 -1.254388263 -0.021453871 -0.966362094 -0.341721729
[61] 2.095180054 -0.965686553 0.446818887 -2.368604638 -0.886596253
[66] -0.381073225 0.807133157 -0.103766058 -0.252562200 0.167798098
[71] -0.033800856 -1.355521907 0.494448776 1.033512099 -0.794901768
[76] 0.759885915 -1.055640817 -1.134050998 -0.655824810 0.490227433
[81] -0.033963228 -0.960394073 1.095277650 -1.054784465 -0.513341454
[86] -0.574448313 -0.925905192 0.278673480 1.116308951 0.659457531
[91] -1.127028052 0.232871589 -1.645300120 0.558419293 -1.397390029
[96] -0.833799256 1.629318150 0.009151313 -0.642608010 0.621507700
> 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.460102247 -0.046702179 0.455681516 -0.564367828 0.055234334
[6] 0.209676401 1.921671523 0.081149065 -0.263351472 2.119239576
[11] 0.396380827 -0.412942358 -0.988268709 -0.856935638 2.381596136
[16] -1.053827555 0.748901008 -0.956712401 1.228060732 -1.092507548
[21] -1.548802326 -0.640045042 0.700134071 -0.107163843 -0.469586866
[26] 0.546461600 1.845329648 -0.002123846 -0.351473109 0.528159218
[31] -0.069614238 -0.088073949 -1.016740124 -0.376849844 -0.965843173
[36] 0.945828995 0.525867700 0.092906937 0.745162231 0.182363181
[41] -0.416284196 1.358576814 -0.004099709 0.998599547 0.859369573
[46] 1.441110354 0.354924517 0.137248876 0.095845695 -0.028298478
[51] 0.101710376 1.473944562 -0.723807622 1.052975740 -0.252704208
[56] 1.176040222 -1.254388263 -0.021453871 -0.966362094 -0.341721729
[61] 2.095180054 -0.965686553 0.446818887 -2.368604638 -0.886596253
[66] -0.381073225 0.807133157 -0.103766058 -0.252562200 0.167798098
[71] -0.033800856 -1.355521907 0.494448776 1.033512099 -0.794901768
[76] 0.759885915 -1.055640817 -1.134050998 -0.655824810 0.490227433
[81] -0.033963228 -0.960394073 1.095277650 -1.054784465 -0.513341454
[86] -0.574448313 -0.925905192 0.278673480 1.116308951 0.659457531
[91] -1.127028052 0.232871589 -1.645300120 0.558419293 -1.397390029
[96] -0.833799256 1.629318150 0.009151313 -0.642608010 0.621507700
> colMin(tmp)
[1] -1.460102247 -0.046702179 0.455681516 -0.564367828 0.055234334
[6] 0.209676401 1.921671523 0.081149065 -0.263351472 2.119239576
[11] 0.396380827 -0.412942358 -0.988268709 -0.856935638 2.381596136
[16] -1.053827555 0.748901008 -0.956712401 1.228060732 -1.092507548
[21] -1.548802326 -0.640045042 0.700134071 -0.107163843 -0.469586866
[26] 0.546461600 1.845329648 -0.002123846 -0.351473109 0.528159218
[31] -0.069614238 -0.088073949 -1.016740124 -0.376849844 -0.965843173
[36] 0.945828995 0.525867700 0.092906937 0.745162231 0.182363181
[41] -0.416284196 1.358576814 -0.004099709 0.998599547 0.859369573
[46] 1.441110354 0.354924517 0.137248876 0.095845695 -0.028298478
[51] 0.101710376 1.473944562 -0.723807622 1.052975740 -0.252704208
[56] 1.176040222 -1.254388263 -0.021453871 -0.966362094 -0.341721729
[61] 2.095180054 -0.965686553 0.446818887 -2.368604638 -0.886596253
[66] -0.381073225 0.807133157 -0.103766058 -0.252562200 0.167798098
[71] -0.033800856 -1.355521907 0.494448776 1.033512099 -0.794901768
[76] 0.759885915 -1.055640817 -1.134050998 -0.655824810 0.490227433
[81] -0.033963228 -0.960394073 1.095277650 -1.054784465 -0.513341454
[86] -0.574448313 -0.925905192 0.278673480 1.116308951 0.659457531
[91] -1.127028052 0.232871589 -1.645300120 0.558419293 -1.397390029
[96] -0.833799256 1.629318150 0.009151313 -0.642608010 0.621507700
> colMedians(tmp)
[1] -1.460102247 -0.046702179 0.455681516 -0.564367828 0.055234334
[6] 0.209676401 1.921671523 0.081149065 -0.263351472 2.119239576
[11] 0.396380827 -0.412942358 -0.988268709 -0.856935638 2.381596136
[16] -1.053827555 0.748901008 -0.956712401 1.228060732 -1.092507548
[21] -1.548802326 -0.640045042 0.700134071 -0.107163843 -0.469586866
[26] 0.546461600 1.845329648 -0.002123846 -0.351473109 0.528159218
[31] -0.069614238 -0.088073949 -1.016740124 -0.376849844 -0.965843173
[36] 0.945828995 0.525867700 0.092906937 0.745162231 0.182363181
[41] -0.416284196 1.358576814 -0.004099709 0.998599547 0.859369573
[46] 1.441110354 0.354924517 0.137248876 0.095845695 -0.028298478
[51] 0.101710376 1.473944562 -0.723807622 1.052975740 -0.252704208
[56] 1.176040222 -1.254388263 -0.021453871 -0.966362094 -0.341721729
[61] 2.095180054 -0.965686553 0.446818887 -2.368604638 -0.886596253
[66] -0.381073225 0.807133157 -0.103766058 -0.252562200 0.167798098
[71] -0.033800856 -1.355521907 0.494448776 1.033512099 -0.794901768
[76] 0.759885915 -1.055640817 -1.134050998 -0.655824810 0.490227433
[81] -0.033963228 -0.960394073 1.095277650 -1.054784465 -0.513341454
[86] -0.574448313 -0.925905192 0.278673480 1.116308951 0.659457531
[91] -1.127028052 0.232871589 -1.645300120 0.558419293 -1.397390029
[96] -0.833799256 1.629318150 0.009151313 -0.642608010 0.621507700
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -1.460102 -0.04670218 0.4556815 -0.5643678 0.05523433 0.2096764 1.921672
[2,] -1.460102 -0.04670218 0.4556815 -0.5643678 0.05523433 0.2096764 1.921672
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.08114906 -0.2633515 2.11924 0.3963808 -0.4129424 -0.9882687 -0.8569356
[2,] 0.08114906 -0.2633515 2.11924 0.3963808 -0.4129424 -0.9882687 -0.8569356
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 2.381596 -1.053828 0.748901 -0.9567124 1.228061 -1.092508 -1.548802
[2,] 2.381596 -1.053828 0.748901 -0.9567124 1.228061 -1.092508 -1.548802
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.640045 0.7001341 -0.1071638 -0.4695869 0.5464616 1.84533 -0.002123846
[2,] -0.640045 0.7001341 -0.1071638 -0.4695869 0.5464616 1.84533 -0.002123846
[,29] [,30] [,31] [,32] [,33] [,34]
[1,] -0.3514731 0.5281592 -0.06961424 -0.08807395 -1.01674 -0.3768498
[2,] -0.3514731 0.5281592 -0.06961424 -0.08807395 -1.01674 -0.3768498
[,35] [,36] [,37] [,38] [,39] [,40] [,41]
[1,] -0.9658432 0.945829 0.5258677 0.09290694 0.7451622 0.1823632 -0.4162842
[2,] -0.9658432 0.945829 0.5258677 0.09290694 0.7451622 0.1823632 -0.4162842
[,42] [,43] [,44] [,45] [,46] [,47] [,48]
[1,] 1.358577 -0.004099709 0.9985995 0.8593696 1.44111 0.3549245 0.1372489
[2,] 1.358577 -0.004099709 0.9985995 0.8593696 1.44111 0.3549245 0.1372489
[,49] [,50] [,51] [,52] [,53] [,54] [,55]
[1,] 0.0958457 -0.02829848 0.1017104 1.473945 -0.7238076 1.052976 -0.2527042
[2,] 0.0958457 -0.02829848 0.1017104 1.473945 -0.7238076 1.052976 -0.2527042
[,56] [,57] [,58] [,59] [,60] [,61] [,62]
[1,] 1.17604 -1.254388 -0.02145387 -0.9663621 -0.3417217 2.09518 -0.9656866
[2,] 1.17604 -1.254388 -0.02145387 -0.9663621 -0.3417217 2.09518 -0.9656866
[,63] [,64] [,65] [,66] [,67] [,68] [,69]
[1,] 0.4468189 -2.368605 -0.8865963 -0.3810732 0.8071332 -0.1037661 -0.2525622
[2,] 0.4468189 -2.368605 -0.8865963 -0.3810732 0.8071332 -0.1037661 -0.2525622
[,70] [,71] [,72] [,73] [,74] [,75] [,76]
[1,] 0.1677981 -0.03380086 -1.355522 0.4944488 1.033512 -0.7949018 0.7598859
[2,] 0.1677981 -0.03380086 -1.355522 0.4944488 1.033512 -0.7949018 0.7598859
[,77] [,78] [,79] [,80] [,81] [,82] [,83]
[1,] -1.055641 -1.134051 -0.6558248 0.4902274 -0.03396323 -0.9603941 1.095278
[2,] -1.055641 -1.134051 -0.6558248 0.4902274 -0.03396323 -0.9603941 1.095278
[,84] [,85] [,86] [,87] [,88] [,89] [,90]
[1,] -1.054784 -0.5133415 -0.5744483 -0.9259052 0.2786735 1.116309 0.6594575
[2,] -1.054784 -0.5133415 -0.5744483 -0.9259052 0.2786735 1.116309 0.6594575
[,91] [,92] [,93] [,94] [,95] [,96] [,97]
[1,] -1.127028 0.2328716 -1.6453 0.5584193 -1.39739 -0.8337993 1.629318
[2,] -1.127028 0.2328716 -1.6453 0.5584193 -1.39739 -0.8337993 1.629318
[,98] [,99] [,100]
[1,] 0.009151313 -0.642608 0.6215077
[2,] 0.009151313 -0.642608 0.6215077
>
>
> Max(tmp2)
[1] 2.320718
> Min(tmp2)
[1] -1.971441
> mean(tmp2)
[1] 0.01260838
> Sum(tmp2)
[1] 1.260838
> Var(tmp2)
[1] 0.8622622
>
> rowMeans(tmp2)
[1] -0.721550877 1.271110998 1.492191686 0.115717615 -0.046831800
[6] 1.142836873 0.206745426 0.420117726 -0.020284557 1.093724561
[11] 0.865188140 0.682916406 -0.794248016 1.672983433 -0.340542385
[16] -0.309682171 0.167322394 -1.499296239 -0.056194483 0.111207112
[21] -0.315987925 -0.374140478 1.908205401 -0.540984195 -0.901352689
[26] 0.070233773 -0.086884810 0.999226938 -1.064694915 0.170458572
[31] -1.222750637 -1.612220777 -0.454007869 0.011445029 0.716872644
[36] -1.006594405 1.231751923 0.031827416 0.612094691 0.748343652
[41] -0.759561523 -0.050388053 0.663776335 0.234367628 0.104532024
[46] -0.755000816 0.775038605 -0.014131638 0.219309341 1.149363228
[51] -0.339797718 1.844236095 1.639048081 -0.219743747 -1.041856111
[56] -0.501605583 0.879970396 0.003017538 -0.636997212 -1.307311395
[61] 0.603078221 1.176442370 0.884299896 -1.377195483 -0.930382254
[66] -0.165372430 -1.545522466 -0.629408290 0.155711769 0.638966630
[71] 0.574451809 0.607153531 1.096564516 -1.017536387 2.320718262
[76] -1.269589865 -1.103796758 0.433063770 1.992708609 -0.645863161
[81] -0.899625173 -0.134302705 -1.377912820 -1.971441310 0.050719645
[86] -0.729312520 0.057716202 0.457776775 0.766258457 -0.267127709
[91] 0.455605919 0.696393333 0.736562324 0.016561569 -1.774201268
[96] -1.303790078 0.767184510 -0.103528092 -0.887137648 -1.354592399
> rowSums(tmp2)
[1] -0.721550877 1.271110998 1.492191686 0.115717615 -0.046831800
[6] 1.142836873 0.206745426 0.420117726 -0.020284557 1.093724561
[11] 0.865188140 0.682916406 -0.794248016 1.672983433 -0.340542385
[16] -0.309682171 0.167322394 -1.499296239 -0.056194483 0.111207112
[21] -0.315987925 -0.374140478 1.908205401 -0.540984195 -0.901352689
[26] 0.070233773 -0.086884810 0.999226938 -1.064694915 0.170458572
[31] -1.222750637 -1.612220777 -0.454007869 0.011445029 0.716872644
[36] -1.006594405 1.231751923 0.031827416 0.612094691 0.748343652
[41] -0.759561523 -0.050388053 0.663776335 0.234367628 0.104532024
[46] -0.755000816 0.775038605 -0.014131638 0.219309341 1.149363228
[51] -0.339797718 1.844236095 1.639048081 -0.219743747 -1.041856111
[56] -0.501605583 0.879970396 0.003017538 -0.636997212 -1.307311395
[61] 0.603078221 1.176442370 0.884299896 -1.377195483 -0.930382254
[66] -0.165372430 -1.545522466 -0.629408290 0.155711769 0.638966630
[71] 0.574451809 0.607153531 1.096564516 -1.017536387 2.320718262
[76] -1.269589865 -1.103796758 0.433063770 1.992708609 -0.645863161
[81] -0.899625173 -0.134302705 -1.377912820 -1.971441310 0.050719645
[86] -0.729312520 0.057716202 0.457776775 0.766258457 -0.267127709
[91] 0.455605919 0.696393333 0.736562324 0.016561569 -1.774201268
[96] -1.303790078 0.767184510 -0.103528092 -0.887137648 -1.354592399
> 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.721550877 1.271110998 1.492191686 0.115717615 -0.046831800
[6] 1.142836873 0.206745426 0.420117726 -0.020284557 1.093724561
[11] 0.865188140 0.682916406 -0.794248016 1.672983433 -0.340542385
[16] -0.309682171 0.167322394 -1.499296239 -0.056194483 0.111207112
[21] -0.315987925 -0.374140478 1.908205401 -0.540984195 -0.901352689
[26] 0.070233773 -0.086884810 0.999226938 -1.064694915 0.170458572
[31] -1.222750637 -1.612220777 -0.454007869 0.011445029 0.716872644
[36] -1.006594405 1.231751923 0.031827416 0.612094691 0.748343652
[41] -0.759561523 -0.050388053 0.663776335 0.234367628 0.104532024
[46] -0.755000816 0.775038605 -0.014131638 0.219309341 1.149363228
[51] -0.339797718 1.844236095 1.639048081 -0.219743747 -1.041856111
[56] -0.501605583 0.879970396 0.003017538 -0.636997212 -1.307311395
[61] 0.603078221 1.176442370 0.884299896 -1.377195483 -0.930382254
[66] -0.165372430 -1.545522466 -0.629408290 0.155711769 0.638966630
[71] 0.574451809 0.607153531 1.096564516 -1.017536387 2.320718262
[76] -1.269589865 -1.103796758 0.433063770 1.992708609 -0.645863161
[81] -0.899625173 -0.134302705 -1.377912820 -1.971441310 0.050719645
[86] -0.729312520 0.057716202 0.457776775 0.766258457 -0.267127709
[91] 0.455605919 0.696393333 0.736562324 0.016561569 -1.774201268
[96] -1.303790078 0.767184510 -0.103528092 -0.887137648 -1.354592399
> rowMin(tmp2)
[1] -0.721550877 1.271110998 1.492191686 0.115717615 -0.046831800
[6] 1.142836873 0.206745426 0.420117726 -0.020284557 1.093724561
[11] 0.865188140 0.682916406 -0.794248016 1.672983433 -0.340542385
[16] -0.309682171 0.167322394 -1.499296239 -0.056194483 0.111207112
[21] -0.315987925 -0.374140478 1.908205401 -0.540984195 -0.901352689
[26] 0.070233773 -0.086884810 0.999226938 -1.064694915 0.170458572
[31] -1.222750637 -1.612220777 -0.454007869 0.011445029 0.716872644
[36] -1.006594405 1.231751923 0.031827416 0.612094691 0.748343652
[41] -0.759561523 -0.050388053 0.663776335 0.234367628 0.104532024
[46] -0.755000816 0.775038605 -0.014131638 0.219309341 1.149363228
[51] -0.339797718 1.844236095 1.639048081 -0.219743747 -1.041856111
[56] -0.501605583 0.879970396 0.003017538 -0.636997212 -1.307311395
[61] 0.603078221 1.176442370 0.884299896 -1.377195483 -0.930382254
[66] -0.165372430 -1.545522466 -0.629408290 0.155711769 0.638966630
[71] 0.574451809 0.607153531 1.096564516 -1.017536387 2.320718262
[76] -1.269589865 -1.103796758 0.433063770 1.992708609 -0.645863161
[81] -0.899625173 -0.134302705 -1.377912820 -1.971441310 0.050719645
[86] -0.729312520 0.057716202 0.457776775 0.766258457 -0.267127709
[91] 0.455605919 0.696393333 0.736562324 0.016561569 -1.774201268
[96] -1.303790078 0.767184510 -0.103528092 -0.887137648 -1.354592399
>
> colMeans(tmp2)
[1] 0.01260838
> colSums(tmp2)
[1] 1.260838
> colVars(tmp2)
[1] 0.8622622
> colSd(tmp2)
[1] 0.9285808
> colMax(tmp2)
[1] 2.320718
> colMin(tmp2)
[1] -1.971441
> colMedians(tmp2)
[1] 0.0140033
> colRanges(tmp2)
[,1]
[1,] -1.971441
[2,] 2.320718
>
> 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] -1.8889646 0.3756330 -0.5896119 2.7352975 3.4388415 2.4105733
[7] -5.3286159 -4.9755061 0.3243304 -5.1576868
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.92835280
[2,] -0.88682141
[3,] -0.04203992
[4,] 0.60395118
[5,] 1.12683425
>
> rowApply(tmp,sum)
[1] -1.7898610 -4.0909720 -1.9174610 1.1614245 0.2360164 -2.9916144
[7] -2.8474225 3.4729716 -2.1918315 2.3030405
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 9 8 1 5 2 9 7 9 6 1
[2,] 3 3 3 9 5 5 8 1 10 5
[3,] 5 4 7 10 8 2 5 4 4 3
[4,] 7 9 10 4 3 7 6 8 5 10
[5,] 2 1 2 7 10 6 9 10 9 7
[6,] 10 7 4 8 6 4 10 6 2 8
[7,] 8 2 9 6 1 3 3 3 3 4
[8,] 6 5 5 1 4 8 1 5 8 2
[9,] 4 10 6 3 7 10 2 2 7 9
[10,] 1 6 8 2 9 1 4 7 1 6
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.9932311 -2.1736355 -2.4184825 2.1686935 -4.0716431 0.9383987
[7] -4.0895149 -1.4918634 3.1630910 -1.8743947 -0.1543216 0.0735632
[13] 0.8995363 -3.8281454 -3.4218313 -3.5410933 1.7533147 4.6843106
[19] 2.4172039 1.0825768
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.8218554
[2,] -0.3667861
[3,] 0.4715024
[4,] 0.8505798
[5,] 0.8597904
>
> rowApply(tmp,sum)
[1] 10.177301 -2.479783 -7.200638 -2.782740 -6.605147
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 13 15 18 7 12
[2,] 2 17 1 11 16
[3,] 19 1 12 2 11
[4,] 12 19 11 16 6
[5,] 6 2 4 17 1
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.8505798 -0.89304583 1.6884000 0.8125470 -0.08805495 1.3556831
[2,] 0.4715024 0.61122517 -1.9496290 1.2469598 -1.30856649 -0.1644534
[3,] 0.8597904 -2.20101368 -0.1944396 -0.3219768 -1.24856295 -1.6591401
[4,] -0.8218554 0.01467853 -1.5677464 0.9856589 1.16539853 0.4439337
[5,] -0.3667861 0.29452029 -0.3950675 -0.5544955 -2.59185727 0.9623754
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.2767305 0.2050924 1.3747048 -0.06800496 -0.1906834 0.9105641
[2,] -1.2931000 0.2118709 0.1540043 -0.52240718 -0.4861440 0.4540767
[3,] -0.3472513 -0.7520345 -0.8872556 -0.09746107 -0.6489337 -0.3401818
[4,] -0.4379215 -1.2643431 1.9903823 -0.72020917 1.5964427 -0.5984776
[5,] -1.7345115 0.1075510 0.5312552 -0.46631230 -0.4250032 -0.3524182
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.4904570 -1.2160442 0.7846850 0.03138512 1.6302539 1.9404892
[2,] -0.2457753 0.3274605 -0.9296989 -0.62593481 -1.0248388 0.7494404
[3,] 0.9456940 -1.1425979 -1.3946277 0.33655504 1.2055456 0.1459494
[4,] 0.1434651 -0.9300008 -0.8551630 -1.94719301 0.3517537 1.1747331
[5,] -0.4343044 -0.8669629 -1.0270267 -1.33590567 -0.4093998 0.6736985
[,19] [,20]
[1,] 0.95799411 -0.12297040
[2,] 1.32961030 0.51461393
[3,] 0.01836405 0.52294062
[4,] -1.55419112 0.04791505
[5,] 1.66542658 0.12007757
>
>
> 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.24-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.24-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.24-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.24-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.1822594 -0.19044 -0.2151498 -2.207651 -0.6130201 -1.09322 -0.4955378
col8 col9 col10 col11 col12 col13 col14
row1 0.9623722 -1.093898 -0.2093213 0.7894905 1.068195 -1.343219 -1.27022
col15 col16 col17 col18 col19 col20
row1 0.6920055 -1.418196 0.8445401 0.0004771193 1.636364 -1.879883
> tmp[,"col10"]
col10
row1 -0.20932133
row2 -0.03150324
row3 0.81070882
row4 0.71856363
row5 -0.02089447
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 0.18225938 -0.1904400 -0.2151498 -2.207651 -0.61302009 -1.093220
row5 0.07279565 -0.3041412 -0.6389873 1.673456 -0.09973072 1.387867
col7 col8 col9 col10 col11 col12
row1 -0.4955378 0.9623722 -1.0938976 -0.20932133 0.7894905 1.068195
row5 1.3380705 -1.3862749 -0.0975498 -0.02089447 -0.8330288 1.036921
col13 col14 col15 col16 col17 col18 col19
row1 -1.3432193 -1.270220 0.6920055 -1.418196 0.8445401 0.0004771193 1.6363642
row5 -0.2737355 -1.141671 0.5100208 -2.998064 0.2054121 0.7671872474 0.2065796
col20
row1 -1.8798834
row5 0.2686082
> tmp[,c("col6","col20")]
col6 col20
row1 -1.0932197 -1.8798834
row2 -1.1014172 0.5328528
row3 0.2479466 0.6755780
row4 1.1663918 -0.1815950
row5 1.3878673 0.2686082
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -1.093220 -1.8798834
row5 1.387867 0.2686082
>
>
>
>
> 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 48.22768 49.34929 49.98823 51.25348 49.88265 105.5704 49.32243 49.0932
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.17724 50.21773 50.05853 49.40935 47.81271 50.72018 51.1129 47.78154
col17 col18 col19 col20
row1 49.07318 50.75526 51.19674 103.7644
> tmp[,"col10"]
col10
row1 50.21773
row2 29.99300
row3 28.33909
row4 28.48266
row5 50.73046
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.22768 49.34929 49.98823 51.25348 49.88265 105.5704 49.32243 49.09320
row5 48.79905 50.28464 50.87430 51.73336 49.92771 103.4598 52.08286 48.79638
col9 col10 col11 col12 col13 col14 col15 col16
row1 51.17724 50.21773 50.05853 49.40935 47.81271 50.72018 51.11290 47.78154
row5 51.67882 50.73046 50.66342 49.52653 50.79882 49.02297 47.78625 50.13776
col17 col18 col19 col20
row1 49.07318 50.75526 51.19674 103.7644
row5 49.68955 50.57337 49.82806 104.2410
> tmp[,c("col6","col20")]
col6 col20
row1 105.57042 103.76444
row2 76.05716 76.22042
row3 74.41990 74.03873
row4 75.58603 76.31677
row5 103.45980 104.24095
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.5704 103.7644
row5 103.4598 104.2410
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.5704 103.7644
row5 103.4598 104.2410
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.4606114
[2,] -0.6010208
[3,] -0.2255524
[4,] -0.4015333
[5,] 0.8303724
> tmp[,c("col17","col7")]
col17 col7
[1,] 1.2847425 0.6061056
[2,] 1.2472016 -0.6867849
[3,] -1.0707004 -0.2307069
[4,] 0.4962950 0.6778319
[5,] 0.7032204 -0.7360467
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.16709717 0.9662902
[2,] -0.05116991 -1.6182731
[3,] -0.99175815 -1.0857638
[4,] -0.53062476 -0.8291939
[5,] -0.37948813 1.8901853
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.1670972
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.16709717
[2,] -0.05116991
>
>
>
> 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.2405789 1.45707686 -1.5451160 0.7192409 -0.794546 0.3720227
row1 -0.8345710 -0.01829294 -0.5233544 0.9886324 -1.093596 -0.7159536
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row3 -0.9365976 0.8239830 0.7593349 -1.8364141 1.020480 -0.8184869 0.1886545
row1 0.6630456 -0.4887464 -1.0348995 -0.2095971 1.685068 -0.1822567 -0.1054331
[,14] [,15] [,16] [,17] [,18] [,19]
row3 0.99524122 0.23492991 0.5807124 0.4241644 0.3431457 -0.0447909
row1 -0.03421598 -0.05784775 0.5529853 0.1603176 0.8340741 -0.7158466
[,20]
row3 0.3521385
row1 -0.7480630
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -1.82931 -0.8167761 -0.931674 -0.6816467 1.33556 -2.218169 -0.09758239
[,8] [,9] [,10]
row2 -1.760435 -0.5848347 -1.451659
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.06343089 -0.04936202 -0.9878121 2.283315 -0.5401108 0.472266 -1.463432
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.9014154 -0.4607096 0.5926455 1.225912 -0.3386131 0.1823224 0.9198153
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.818639 0.7616501 1.245078 0.8191864 0.1764844 0.5843413
>
>
> 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: 0x5ab0fe295540>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM284c356c39aaa4"
[2] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM284c3541d7d712"
[3] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM284c3572105113"
[4] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM284c353d97bfaf"
[5] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM284c351e5cfcb3"
[6] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM284c355f9fc1ed"
[7] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM284c354e35bc63"
[8] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM284c3516479517"
[9] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM284c3528ea8f5d"
[10] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM284c351c7d4ff"
[11] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM284c356a6840cb"
[12] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM284c35311cf345"
[13] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM284c35213b18d4"
[14] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM284c351fc77c50"
[15] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM284c35126f5094"
>
>
> ### 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: 0x5ab0fc792fc0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5ab0fc792fc0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5ab0fc792fc0>
> rowMedians(tmp)
[1] 0.0088861336 0.0154875594 0.6068522125 0.0089254735 -0.0118822418
[6] 0.6506104994 0.5091244146 -0.0094916173 -0.2089863799 0.3886371829
[11] 0.2726412758 0.3074768222 0.4392320674 -0.3862399009 -0.0683471169
[16] -0.3683453392 -0.1897600076 0.0480777294 -0.2706666930 0.0296653556
[21] 0.1111427461 0.1609102315 -0.6472105107 0.0848810967 0.1371837154
[26] -0.0165453104 -0.7393582922 -0.3359694051 -0.5367902397 0.7430373060
[31] 0.0985616324 0.1577866275 0.0774104977 -0.0436193237 0.1757249160
[36] -0.2604029274 -0.2740586081 -0.2294161562 0.1407992339 -0.5220796560
[41] -0.1364176909 -0.3711833181 -0.3767898067 0.0228227463 -1.3008981363
[46] 0.0042887915 -0.4937109297 -0.0481509474 -0.0312687651 0.0001397354
[51] 0.3300064618 0.1746701040 0.1739320972 -0.4214510355 -0.1419611431
[56] 0.3941657357 0.1614744345 0.1035005766 0.0254006344 0.2926316787
[61] 0.1433131317 0.6246503647 -0.5755445011 0.0130008308 0.0613416778
[66] 0.3578269090 -0.1155557179 0.0809734491 0.3576357427 -0.0481623050
[71] -0.0742598720 -0.6122040226 0.0487499463 -0.1812139443 -0.0631999705
[76] 0.1192286173 -0.0835706620 -0.0693241076 0.3484380111 -0.2548036196
[81] 0.4695879104 -0.2807313274 -0.1712771461 0.2693826398 0.4764989433
[86] 0.3805465598 -0.1702772421 0.2168073367 0.4410290431 -0.2310238221
[91] 0.3402445468 -0.0831340273 -0.1650307736 0.3934201690 -0.4842362586
[96] -0.2994717136 0.3158546351 -0.0614605377 -0.6632098026 -0.8184719153
[101] -0.3965683119 -0.2706366888 -0.4457872537 0.2037049279 -0.1828532126
[106] -0.1703609746 -0.1166723741 0.6635077229 0.3738754741 -0.2191638718
[111] -0.3659826520 0.3226560533 -0.0350906464 0.3001652046 -0.1903148285
[116] -0.5139307154 0.1667639260 -0.3301403462 -0.2766851822 0.1121313621
[121] 0.4287949717 -0.1323551397 -0.0321708556 -0.4303932404 -0.0861171564
[126] 0.2811269218 0.0158786312 -0.0632654660 -0.2949874631 0.3616443206
[131] -0.1592698863 -0.0544082120 -0.6668335136 0.5760904987 0.6336917071
[136] 0.0227610192 0.0267680357 -0.0837279194 -0.5689291654 0.2973930907
[141] 0.2655096681 -0.0937406201 -0.2161683137 0.0609864911 -0.1699652916
[146] -0.4351123620 -0.3035871364 0.4529180058 -0.4273214711 -0.0921630854
[151] 0.0207106175 -0.0204752559 0.0678885191 0.0959595753 0.4810343150
[156] 0.4231698845 -0.0124231998 -0.2043730612 -0.0533314495 0.2206081336
[161] 0.0479401464 0.0124775467 0.1782343100 -0.2620997875 0.0825358888
[166] -0.1391913985 -0.0339832389 -0.0469220171 -0.1392436211 -0.6998630767
[171] -0.1428421020 -0.2110409951 -0.1114796086 0.3104993864 0.0033187344
[176] 0.3716928018 -0.3002614839 -0.1240956733 -0.3310777820 -0.0825906992
[181] 0.6832908434 0.0799039906 -0.3855797446 -0.4365701372 -0.3299793575
[186] -0.3080794313 -0.4823745884 -0.2743048137 -0.5994952226 -0.6688224260
[191] 0.2841419159 -0.0812168174 -0.0956496067 0.3537193077 0.3948837250
[196] 0.1229401532 0.5864563290 -0.2093922867 -0.2807581243 0.1673823744
[201] 0.2984360228 -0.0661464429 0.3817290785 0.0713916825 0.5472415967
[206] 0.1299398661 -0.1001293559 0.0265574656 0.7042902169 0.1395484874
[211] 0.2987309677 0.2592186977 -0.0004433842 -0.3294907971 -0.2803978252
[216] 0.1325528649 0.2741366754 0.0115597048 0.0453470136 -0.0491108172
[221] -0.1255050615 0.3903218544 0.0306165313 0.2325537512 0.3000059060
[226] -0.1899889297 0.6698332996 -0.1358900462 -0.0709323664 -0.2723357951
>
> proc.time()
user system elapsed
1.296 0.667 1.953
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> prefix <- "dbmtest"
> directory <- getwd()
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x57a074dee520>
> .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: 0x57a074dee520>
> .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: 0x57a074dee520>
> .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: 0x57a074dee520>
> 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: 0x57a074997f60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57a074997f60>
> .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: 0x57a074997f60>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57a074997f60>
> .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: 0x57a074997f60>
> 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: 0x57a075541b40>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57a075541b40>
> .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: 0x57a075541b40>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x57a075541b40>
> .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: 0x57a075541b40>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x57a075541b40>
> .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: 0x57a075541b40>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x57a075541b40>
> .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: 0x57a075541b40>
> 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: 0x57a07557ebc0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x57a07557ebc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57a07557ebc0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57a07557ebc0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile284cc4160ac8d3" "BufferedMatrixFile284cc4f8f79e1"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile284cc4160ac8d3" "BufferedMatrixFile284cc4f8f79e1"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x57a076906de0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57a076906de0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x57a076906de0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x57a076906de0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x57a076906de0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x57a076906de0>
> .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: 0x57a07463cf80>
> .Call("R_bm_AddColumn",P)
<pointer: 0x57a07463cf80>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x57a07463cf80>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x57a07463cf80>
> 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: 0x57a0755d7690>
> .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: 0x57a0755d7690>
> rm(P)
>
> proc.time()
user system elapsed
0.251 0.042 0.281
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100 0
> buffer.dim(Temp)
[1] 1 1
>
>
> proc.time()
user system elapsed
0.244 0.051 0.283