| Back to Build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-02-11 11:32 -0500 (Wed, 11 Feb 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences" | 4862 |
| 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 255/2351 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| See other builds for BufferedMatrix in R Universe. | ||||||||||||||
|
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
| Package: BufferedMatrix |
| Version: 1.75.0 |
| Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz |
| StartedAt: 2026-02-10 22:05:56 -0500 (Tue, 10 Feb 2026) |
| EndedAt: 2026-02-10 22:06:21 -0500 (Tue, 10 Feb 2026) |
| EllapsedTime: 25.0 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2026-01-15 r89304)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
* running under: Ubuntu 24.04.3 LTS
* using session charset: UTF-8
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... OK
* used C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
* checking installed package size ... OK
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... NOTE
checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup?
209 | $x^{power}$ elementwise of the matrix
| ^
prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword
prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details
prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value
prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references
prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso
prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking compiled code ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* checking files in ‘vignettes’ ... OK
* checking examples ... NONE
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ...
Running ‘Rcodetesting.R’
Running ‘c_code_level_tests.R’
Running ‘objectTesting.R’
Running ‘rawCalltesting.R’
OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE
Status: 1 NOTE
See
‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.23-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
1580 | if (!(Matrix->readonly) & setting){
| ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
3327 | static int sort_double(const double *a1,const double *a2){
| ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.23-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.23-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.23-bioc/R/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’
Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’
Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1))
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
Adding Additional Column
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
0.000000 1.000000 2.000000 3.000000 4.000000 0.000000
1.000000 2.000000 3.000000 4.000000 5.000000 0.000000
2.000000 3.000000 4.000000 5.000000 6.000000 0.000000
3.000000 4.000000 5.000000 6.000000 7.000000 0.000000
4.000000 5.000000 6.000000 7.000000 8.000000 0.000000
Reassigning values
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 3
Buffer Cols: 3
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Activating Row Buffer
In row mode: 1
1.000000 6.000000 11.000000 16.000000 21.000000 26.000000
2.000000 7.000000 12.000000 17.000000 22.000000 27.000000
3.000000 8.000000 13.000000 18.000000 23.000000 28.000000
4.000000 9.000000 14.000000 19.000000 24.000000 29.000000
5.000000 10.000000 15.000000 20.000000 25.000000 30.000000
Squaring Last Column
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
5.000000 10.000000 15.000000 20.000000 25.000000 900.000000
Square rooting Last Row, then turing off Row Buffer
In row mode: 0
Checking on value that should be not be in column buffer2.236068
1.000000 6.000000 11.000000 16.000000 21.000000 676.000000
2.000000 7.000000 12.000000 17.000000 22.000000 729.000000
3.000000 8.000000 13.000000 18.000000 23.000000 784.000000
4.000000 9.000000 14.000000 19.000000 24.000000 841.000000
2.236068 3.162278 3.872983 4.472136 5.000000 30.000000
Single Indexing. Assign each value its square
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Resizing Buffers Smaller
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
1.000000 36.000000 121.000000 256.000000 441.000000 676.000000
4.000000 49.000000 144.000000 289.000000 484.000000 729.000000
9.000000 64.000000 169.000000 324.000000 529.000000 784.000000
16.000000 81.000000 196.000000 361.000000 576.000000 841.000000
25.000000 100.000000 225.000000 400.000000 625.000000 900.000000
Activating Row Mode.
Resizing Buffers
Checking dimensions
Rows: 5
Cols: 6
Buffer Rows: 1
Buffer Cols: 1
Activating ReadOnly Mode.
The results of assignment is: 0
Printing matrix reversed.
900.000000 625.000000 400.000000 225.000000 100.000000 25.000000
841.000000 576.000000 361.000000 196.000000 81.000000 16.000000
784.000000 529.000000 324.000000 169.000000 64.000000 9.000000
729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000
676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000
[[1]]
[1] 0
>
> proc.time()
user system elapsed
0.243 0.053 0.282
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
>
> ### this is used to control how many repetitions in something below
> ### higher values result in more checks.
> nreps <-100 ##20000
>
>
> ## test creation and some simple assignments and subsetting operations
>
> ## first on single elements
> tmp <- createBufferedMatrix(1000,10)
>
> tmp[10,5]
[1] 0
> tmp[10,5] <- 10
> tmp[10,5]
[1] 10
> tmp[10,5] <- 12.445
> tmp[10,5]
[1] 12.445
>
>
>
> ## now testing accessing multiple elements
> tmp2 <- createBufferedMatrix(10,20)
>
>
> tmp2[3,1] <- 51.34
> tmp2[9,2] <- 9.87654
> tmp2[,1:2]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[,-(3:20)]
[,1] [,2]
[1,] 0.00 0.00000
[2,] 0.00 0.00000
[3,] 51.34 0.00000
[4,] 0.00 0.00000
[5,] 0.00 0.00000
[6,] 0.00 0.00000
[7,] 0.00 0.00000
[8,] 0.00 0.00000
[9,] 0.00 9.87654
[10,] 0.00 0.00000
> tmp2[3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
> tmp2[-3,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
[1,] 0 0 0 0 0 0 0
[2,] 0 0 0 0 0 0 0
[3,] 0 0 0 0 0 0 0
[4,] 0 0 0 0 0 0 0
[5,] 0 0 0 0 0 0 0
[6,] 0 0 0 0 0 0 0
[7,] 0 0 0 0 0 0 0
[8,] 0 0 0 0 0 0 0
[9,] 0 0 0 0 0 0 0
> tmp2[2,1:3]
[,1] [,2] [,3]
[1,] 0 0 0
> tmp2[3:9,1:3]
[,1] [,2] [,3]
[1,] 51.34 0.00000 0
[2,] 0.00 0.00000 0
[3,] 0.00 0.00000 0
[4,] 0.00 0.00000 0
[5,] 0.00 0.00000 0
[6,] 0.00 0.00000 0
[7,] 0.00 9.87654 0
> tmp2[-4,-4]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0
[4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0
[9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0
[,14] [,15] [,16] [,17] [,18] [,19]
[1,] 0 0 0 0 0 0
[2,] 0 0 0 0 0 0
[3,] 0 0 0 0 0 0
[4,] 0 0 0 0 0 0
[5,] 0 0 0 0 0 0
[6,] 0 0 0 0 0 0
[7,] 0 0 0 0 0 0
[8,] 0 0 0 0 0 0
[9,] 0 0 0 0 0 0
>
> ## now testing accessing/assigning multiple elements
> tmp3 <- createBufferedMatrix(10,10)
>
> for (i in 1:10){
+ for (j in 1:10){
+ tmp3[i,j] <- (j-1)*10 + i
+ }
+ }
>
> tmp3[2:4,2:4]
[,1] [,2] [,3]
[1,] 12 22 32
[2,] 13 23 33
[3,] 14 24 34
> tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
[1,] 11 21 31 11 21 31 91 1 11 1 11 21 31
[2,] 12 22 32 12 22 32 92 2 12 2 12 22 32
[3,] 13 23 33 13 23 33 93 3 13 3 13 23 33
[4,] 14 24 34 14 24 34 94 4 14 4 14 24 34
[5,] 15 25 35 15 25 35 95 5 15 5 15 25 35
[6,] 16 26 36 16 26 36 96 6 16 6 16 26 36
[7,] 17 27 37 17 27 37 97 7 17 7 17 27 37
[8,] 18 28 38 18 28 38 98 8 18 8 18 28 38
[9,] 19 29 39 19 29 39 99 9 19 9 19 29 39
[,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
[1,] 41 51 61 71 81 91 91 81 71 61 51 41
[2,] 42 52 62 72 82 92 92 82 72 62 52 42
[3,] 43 53 63 73 83 93 93 83 73 63 53 43
[4,] 44 54 64 74 84 94 94 84 74 64 54 44
[5,] 45 55 65 75 85 95 95 85 75 65 55 45
[6,] 46 56 66 76 86 96 96 86 76 66 56 46
[7,] 47 57 67 77 87 97 97 87 77 67 57 47
[8,] 48 58 68 78 88 98 98 88 78 68 58 48
[9,] 49 59 69 79 89 99 99 89 79 69 59 49
[,26] [,27] [,28] [,29]
[1,] 31 21 11 1
[2,] 32 22 12 2
[3,] 33 23 13 3
[4,] 34 24 14 4
[5,] 35 25 15 5
[6,] 36 26 16 6
[7,] 37 27 17 7
[8,] 38 28 18 8
[9,] 39 29 19 9
> tmp3[-c(1:5),-c(6:10)]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 16 26 36 46
[2,] 7 17 27 37 47
[3,] 8 18 28 38 48
[4,] 9 19 29 39 49
[5,] 10 20 30 40 50
>
> ## assignment of whole columns
> tmp3[,1] <- c(1:10*100.0)
> tmp3[,1:2] <- tmp3[,1:2]*100
> tmp3[,1:2] <- tmp3[,2:1]
> tmp3[,1:2]
[,1] [,2]
[1,] 1100 1e+04
[2,] 1200 2e+04
[3,] 1300 3e+04
[4,] 1400 4e+04
[5,] 1500 5e+04
[6,] 1600 6e+04
[7,] 1700 7e+04
[8,] 1800 8e+04
[9,] 1900 9e+04
[10,] 2000 1e+05
>
>
> tmp3[,-1] <- tmp3[,1:9]
> tmp3[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1100 1100 1e+04 21 31 41 51 61 71 81
[2,] 1200 1200 2e+04 22 32 42 52 62 72 82
[3,] 1300 1300 3e+04 23 33 43 53 63 73 83
[4,] 1400 1400 4e+04 24 34 44 54 64 74 84
[5,] 1500 1500 5e+04 25 35 45 55 65 75 85
[6,] 1600 1600 6e+04 26 36 46 56 66 76 86
[7,] 1700 1700 7e+04 27 37 47 57 67 77 87
[8,] 1800 1800 8e+04 28 38 48 58 68 78 88
[9,] 1900 1900 9e+04 29 39 49 59 69 79 89
[10,] 2000 2000 1e+05 30 40 50 60 70 80 90
>
> tmp3[,1:2] <- rep(1,10)
> tmp3[,1:2] <- rep(1,20)
> tmp3[,1:2] <- matrix(c(1:5),1,5)
>
> tmp3[,-c(1:8)] <- matrix(c(1:5),1,5)
>
> tmp3[1,] <- 1:10
> tmp3[1,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
> tmp3[-1,] <- c(1,2)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 2 1 2 1 2 1 2 1 2 1
[10,] 1 2 1 2 1 2 1 2 1 2
> tmp3[-c(1:8),] <- matrix(c(1:5),1,5)
> tmp3[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 2 3 4 5 6 7 8 9 10
[2,] 1 2 1 2 1 2 1 2 1 2
[3,] 2 1 2 1 2 1 2 1 2 1
[4,] 1 2 1 2 1 2 1 2 1 2
[5,] 2 1 2 1 2 1 2 1 2 1
[6,] 1 2 1 2 1 2 1 2 1 2
[7,] 2 1 2 1 2 1 2 1 2 1
[8,] 1 2 1 2 1 2 1 2 1 2
[9,] 1 3 5 2 4 1 3 5 2 4
[10,] 2 4 1 3 5 2 4 1 3 5
>
>
> tmp3[1:2,1:2] <- 5555.04
> tmp3[-(1:2),1:2] <- 1234.56789
>
>
>
> ## testing accessors for the directory and prefix
> directory(tmp3)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests"
> prefix(tmp3)
[1] "BM"
>
> ## testing if we can remove these objects
> rm(tmp, tmp2, tmp3)
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 478920 25.6 1048721 56.1 639242 34.2
Vcells 885815 6.8 8388608 64.0 2083259 15.9
>
>
>
>
> ##
> ## checking reads
> ##
>
> tmp2 <- createBufferedMatrix(10,20)
>
> test.sample <- rnorm(10*20)
>
> tmp2[1:10,1:20] <- test.sample
>
> test.matrix <- matrix(test.sample,10,20)
>
> ## testing reads
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ which.col <- sample(1:20,1)
+ if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[,which.col] == test.matrix[,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
> date()
[1] "Tue Feb 10 22:06:12 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] "Tue Feb 10 22:06:12 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: 0x6326aca5fc10>
>
>
>
> 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] "Tue Feb 10 22:06:12 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] "Tue Feb 10 22:06:12 2026"
>
> ColMode(tmp2)
<pointer: 0x6326aca5fc10>
>
>
>
> ### 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,] 103.25019723 1.7744272 1.8475228 -1.5666461
[2,] 0.33394897 -0.3700987 -0.2551698 1.4321956
[3,] 0.04075809 -0.7627099 0.4673697 -1.7627697
[4,] 0.24887899 0.4178389 0.6209557 0.5460812
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 103.25019723 1.7744272 1.8475228 1.5666461
[2,] 0.33394897 0.3700987 0.2551698 1.4321956
[3,] 0.04075809 0.7627099 0.4673697 1.7627697
[4,] 0.24887899 0.4178389 0.6209557 0.5460812
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 10.1612104 1.3320763 1.3592361 1.2516573
[2,] 0.5778832 0.6083573 0.5051433 1.1967437
[3,] 0.2018863 0.8733326 0.6836445 1.3276934
[4,] 0.4988777 0.6464046 0.7880074 0.7389731
>
> my.function <- function(x,power){
+ (x+5)^power
+ }
>
> ewApply(tmp5,my.function,power=2)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 229.86230 40.09519 40.43988 39.08322
[2,] 31.11278 31.45367 30.30660 38.39963
[3,] 27.05962 34.49604 32.30381 40.03970
[4,] 30.23766 31.88189 33.50103 32.93581
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x6326ad8b6ff0>
> exp(tmp5)
<pointer: 0x6326ad8b6ff0>
> log(tmp5,2)
<pointer: 0x6326ad8b6ff0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 478.4283
> Min(tmp5)
[1] 53.15372
> mean(tmp5)
[1] 73.26542
> Sum(tmp5)
[1] 14653.08
> Var(tmp5)
[1] 913.0567
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 93.45476 71.64790 72.92216 69.72684 70.21538 73.34009 70.14849 71.82510
[9] 69.62722 69.74629
> rowSums(tmp5)
[1] 1869.095 1432.958 1458.443 1394.537 1404.308 1466.802 1402.970 1436.502
[9] 1392.544 1394.926
> rowVars(tmp5)
[1] 8279.42533 78.10806 61.76589 80.93600 91.29139 110.25754
[7] 111.74824 70.74326 56.00148 128.49145
> rowSd(tmp5)
[1] 90.991348 8.837876 7.859128 8.996444 9.554653 10.500359 10.571104
[8] 8.410901 7.483413 11.335407
> rowMax(tmp5)
[1] 478.42826 87.88044 85.46296 89.33790 91.74074 93.66437 90.73477
[8] 89.20385 81.53648 89.23193
> rowMin(tmp5)
[1] 62.35924 60.27181 56.32106 53.51333 54.05240 53.15372 54.84701 59.28783
[9] 57.36553 56.29603
>
> colMeans(tmp5)
[1] 106.71176 70.35262 73.90481 71.55630 65.25806 73.22691 71.46853
[8] 66.62448 74.21386 77.55140 76.23961 64.26134 74.40106 69.59408
[15] 73.59965 75.01930 68.34540 73.26884 67.14465 72.56581
> colSums(tmp5)
[1] 1067.1176 703.5262 739.0481 715.5630 652.5806 732.2691 714.6853
[8] 666.2448 742.1386 775.5140 762.3961 642.6134 744.0106 695.9408
[15] 735.9965 750.1930 683.4540 732.6884 671.4465 725.6581
> colVars(tmp5)
[1] 17099.89708 64.85723 62.23164 59.75722 33.86334 108.11747
[7] 154.21657 66.90095 50.02917 121.42255 33.90447 93.02393
[13] 109.28425 76.64877 61.07269 55.41544 133.46678 72.25885
[19] 46.45492 95.62278
> colSd(tmp5)
[1] 130.766575 8.053399 7.888703 7.730279 5.819221 10.397955
[7] 12.418396 8.179300 7.073130 11.019190 5.822754 9.644892
[13] 10.453911 8.754928 7.814902 7.444155 11.552783 8.500520
[19] 6.815785 9.778690
> colMax(tmp5)
[1] 478.42826 83.45288 84.17032 83.33740 77.36471 90.73477 91.74074
[8] 81.51817 84.44481 89.33790 85.85768 85.46296 89.20385 85.28588
[15] 79.63098 85.44681 93.66437 82.89166 79.87404 86.03873
> colMin(tmp5)
[1] 56.32106 60.12536 63.07922 60.97245 57.58318 61.15408 56.16573 58.41502
[9] 65.15011 58.68787 68.15354 53.15372 60.10805 55.71327 55.71793 63.91120
[17] 54.84701 61.65823 53.51333 57.36553
>
>
> ### 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] 93.45476 71.64790 72.92216 69.72684 NA 73.34009 70.14849 71.82510
[9] 69.62722 69.74629
> rowSums(tmp5)
[1] 1869.095 1432.958 1458.443 1394.537 NA 1466.802 1402.970 1436.502
[9] 1392.544 1394.926
> rowVars(tmp5)
[1] 8279.42533 78.10806 61.76589 80.93600 95.79277 110.25754
[7] 111.74824 70.74326 56.00148 128.49145
> rowSd(tmp5)
[1] 90.991348 8.837876 7.859128 8.996444 9.787378 10.500359 10.571104
[8] 8.410901 7.483413 11.335407
> rowMax(tmp5)
[1] 478.42826 87.88044 85.46296 89.33790 NA 93.66437 90.73477
[8] 89.20385 81.53648 89.23193
> rowMin(tmp5)
[1] 62.35924 60.27181 56.32106 53.51333 NA 53.15372 54.84701 59.28783
[9] 57.36553 56.29603
>
> colMeans(tmp5)
[1] 106.71176 70.35262 73.90481 71.55630 65.25806 73.22691 71.46853
[8] 66.62448 74.21386 77.55140 76.23961 64.26134 74.40106 69.59408
[15] 73.59965 75.01930 68.34540 73.26884 NA 72.56581
> colSums(tmp5)
[1] 1067.1176 703.5262 739.0481 715.5630 652.5806 732.2691 714.6853
[8] 666.2448 742.1386 775.5140 762.3961 642.6134 744.0106 695.9408
[15] 735.9965 750.1930 683.4540 732.6884 NA 725.6581
> colVars(tmp5)
[1] 17099.89708 64.85723 62.23164 59.75722 33.86334 108.11747
[7] 154.21657 66.90095 50.02917 121.42255 33.90447 93.02393
[13] 109.28425 76.64877 61.07269 55.41544 133.46678 72.25885
[19] NA 95.62278
> colSd(tmp5)
[1] 130.766575 8.053399 7.888703 7.730279 5.819221 10.397955
[7] 12.418396 8.179300 7.073130 11.019190 5.822754 9.644892
[13] 10.453911 8.754928 7.814902 7.444155 11.552783 8.500520
[19] NA 9.778690
> colMax(tmp5)
[1] 478.42826 83.45288 84.17032 83.33740 77.36471 90.73477 91.74074
[8] 81.51817 84.44481 89.33790 85.85768 85.46296 89.20385 85.28588
[15] 79.63098 85.44681 93.66437 82.89166 NA 86.03873
> colMin(tmp5)
[1] 56.32106 60.12536 63.07922 60.97245 57.58318 61.15408 56.16573 58.41502
[9] 65.15011 58.68787 68.15354 53.15372 60.10805 55.71327 55.71793 63.91120
[17] 54.84701 61.65823 NA 57.36553
>
> Max(tmp5,na.rm=TRUE)
[1] 478.4283
> Min(tmp5,na.rm=TRUE)
[1] 53.15372
> mean(tmp5,na.rm=TRUE)
[1] 73.29644
> Sum(tmp5,na.rm=TRUE)
[1] 14585.99
> Var(tmp5,na.rm=TRUE)
[1] 917.4747
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 93.45476 71.64790 72.92216 69.72684 70.37975 73.34009 70.14849 71.82510
[9] 69.62722 69.74629
> rowSums(tmp5,na.rm=TRUE)
[1] 1869.095 1432.958 1458.443 1394.537 1337.215 1466.802 1402.970 1436.502
[9] 1392.544 1394.926
> rowVars(tmp5,na.rm=TRUE)
[1] 8279.42533 78.10806 61.76589 80.93600 95.79277 110.25754
[7] 111.74824 70.74326 56.00148 128.49145
> rowSd(tmp5,na.rm=TRUE)
[1] 90.991348 8.837876 7.859128 8.996444 9.787378 10.500359 10.571104
[8] 8.410901 7.483413 11.335407
> rowMax(tmp5,na.rm=TRUE)
[1] 478.42826 87.88044 85.46296 89.33790 91.74074 93.66437 90.73477
[8] 89.20385 81.53648 89.23193
> rowMin(tmp5,na.rm=TRUE)
[1] 62.35924 60.27181 56.32106 53.51333 54.05240 53.15372 54.84701 59.28783
[9] 57.36553 56.29603
>
> colMeans(tmp5,na.rm=TRUE)
[1] 106.71176 70.35262 73.90481 71.55630 65.25806 73.22691 71.46853
[8] 66.62448 74.21386 77.55140 76.23961 64.26134 74.40106 69.59408
[15] 73.59965 75.01930 68.34540 73.26884 67.15046 72.56581
> colSums(tmp5,na.rm=TRUE)
[1] 1067.1176 703.5262 739.0481 715.5630 652.5806 732.2691 714.6853
[8] 666.2448 742.1386 775.5140 762.3961 642.6134 744.0106 695.9408
[15] 735.9965 750.1930 683.4540 732.6884 604.3542 725.6581
> colVars(tmp5,na.rm=TRUE)
[1] 17099.89708 64.85723 62.23164 59.75722 33.86334 108.11747
[7] 154.21657 66.90095 50.02917 121.42255 33.90447 93.02393
[13] 109.28425 76.64877 61.07269 55.41544 133.46678 72.25885
[19] 52.26140 95.62278
> colSd(tmp5,na.rm=TRUE)
[1] 130.766575 8.053399 7.888703 7.730279 5.819221 10.397955
[7] 12.418396 8.179300 7.073130 11.019190 5.822754 9.644892
[13] 10.453911 8.754928 7.814902 7.444155 11.552783 8.500520
[19] 7.229205 9.778690
> colMax(tmp5,na.rm=TRUE)
[1] 478.42826 83.45288 84.17032 83.33740 77.36471 90.73477 91.74074
[8] 81.51817 84.44481 89.33790 85.85768 85.46296 89.20385 85.28588
[15] 79.63098 85.44681 93.66437 82.89166 79.87404 86.03873
> colMin(tmp5,na.rm=TRUE)
[1] 56.32106 60.12536 63.07922 60.97245 57.58318 61.15408 56.16573 58.41502
[9] 65.15011 58.68787 68.15354 53.15372 60.10805 55.71327 55.71793 63.91120
[17] 54.84701 61.65823 53.51333 57.36553
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 93.45476 71.64790 72.92216 69.72684 NaN 73.34009 70.14849 71.82510
[9] 69.62722 69.74629
> rowSums(tmp5,na.rm=TRUE)
[1] 1869.095 1432.958 1458.443 1394.537 0.000 1466.802 1402.970 1436.502
[9] 1392.544 1394.926
> rowVars(tmp5,na.rm=TRUE)
[1] 8279.42533 78.10806 61.76589 80.93600 NA 110.25754
[7] 111.74824 70.74326 56.00148 128.49145
> rowSd(tmp5,na.rm=TRUE)
[1] 90.991348 8.837876 7.859128 8.996444 NA 10.500359 10.571104
[8] 8.410901 7.483413 11.335407
> rowMax(tmp5,na.rm=TRUE)
[1] 478.42826 87.88044 85.46296 89.33790 NA 93.66437 90.73477
[8] 89.20385 81.53648 89.23193
> rowMin(tmp5,na.rm=TRUE)
[1] 62.35924 60.27181 56.32106 53.51333 NA 53.15372 54.84701 59.28783
[9] 57.36553 56.29603
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 111.94364 71.40042 74.78025 71.84202 63.91288 73.81831 69.21606
[8] 67.02652 73.07709 78.33091 75.87988 65.39566 75.98917 70.19062
[15] 73.53782 75.33579 68.89034 72.33172 NaN 72.03678
> colSums(tmp5,na.rm=TRUE)
[1] 1007.4928 642.6038 673.0223 646.5782 575.2159 664.3648 622.9445
[8] 603.2387 657.6938 704.9781 682.9189 588.5610 683.9026 631.7156
[15] 661.8404 678.0221 620.0131 650.9855 0.0000 648.3310
> colVars(tmp5,na.rm=TRUE)
[1] 18929.44269 60.61320 61.38873 66.30845 17.73919 117.69739
[7] 116.41549 73.44516 41.74499 129.76457 36.68665 90.17659
[13] 94.57114 82.22641 68.66378 61.21552 146.80933 71.41157
[19] NA 104.42703
> colSd(tmp5,na.rm=TRUE)
[1] 137.584311 7.785448 7.835096 8.143000 4.211791 10.848843
[7] 10.789601 8.570015 6.461036 11.391425 6.056951 9.496136
[13] 9.724769 9.067878 8.286361 7.824035 12.116490 8.450537
[19] NA 10.218954
> colMax(tmp5,na.rm=TRUE)
[1] 478.42826 83.45288 84.17032 83.33740 71.03587 90.73477 88.44831
[8] 81.51817 83.86977 89.33790 85.85768 85.46296 89.20385 85.28588
[15] 79.63098 85.44681 93.66437 82.89166 -Inf 86.03873
> colMin(tmp5,na.rm=TRUE)
[1] 56.32106 60.12536 63.07922 60.97245 57.58318 61.15408 56.16573 58.41502
[9] 65.15011 58.68787 68.15354 53.15372 63.50311 55.71327 55.71793 63.91120
[17] 54.84701 61.65823 Inf 57.36553
>
>
>
>
> 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] 268.3958 393.5003 223.4936 102.2698 398.0461 176.7499 329.6991 355.8267
[9] 153.3083 274.5586
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 268.3958 393.5003 223.4936 102.2698 398.0461 176.7499 329.6991 355.8267
[9] 153.3083 274.5586
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] 2.273737e-13 -4.263256e-14 8.526513e-14 1.136868e-13 8.526513e-14
[6] -4.263256e-14 -5.684342e-14 1.421085e-14 -1.421085e-13 0.000000e+00
[11] -4.547474e-13 -2.842171e-14 1.705303e-13 -2.842171e-14 2.842171e-14
[16] 5.684342e-14 0.000000e+00 -5.684342e-14 -5.684342e-14 3.979039e-13
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
10 14
6 19
3 12
3 1
10 7
4 3
6 12
2 19
9 15
6 8
4 1
2 1
7 17
5 3
7 19
10 5
2 19
5 5
6 18
5 5
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.502765
> Min(tmp)
[1] -2.303369
> mean(tmp)
[1] -0.2075978
> Sum(tmp)
[1] -20.75978
> Var(tmp)
[1] 0.9594013
>
> rowMeans(tmp)
[1] -0.2075978
> rowSums(tmp)
[1] -20.75978
> rowVars(tmp)
[1] 0.9594013
> rowSd(tmp)
[1] 0.9794903
> rowMax(tmp)
[1] 2.502765
> rowMin(tmp)
[1] -2.303369
>
> colMeans(tmp)
[1] -0.4513459190 0.7058436977 -1.8482978010 0.4115979761 0.9804038606
[6] 0.8588039470 0.9458366053 -1.6256720924 -2.1668210933 -1.0201350504
[11] 1.4333260010 -0.3471372689 -1.5657653991 0.2599744672 0.1975237752
[16] -0.3565775985 0.7851591794 -0.2941426513 -1.4243592320 -0.6374372443
[21] -1.3414624845 -0.2863120634 0.0968957448 -0.7558123132 -0.4057970338
[26] 0.3076045899 -1.3005702656 -1.9521376650 -0.1925081546 0.1863755098
[31] 0.0136494369 -1.2741585970 0.1885122560 1.0437396801 -1.0962511368
[36] -1.1024941845 -0.6685106325 -0.0163152138 -1.4634988251 0.3966661271
[41] 0.0088651126 1.3180590386 0.7313883122 -0.5329600997 0.1377411124
[46] 1.1872828745 0.0653856932 -0.3840682784 0.8852027761 0.6670487159
[51] -0.9272430062 -1.0587966927 0.5715833804 -0.1751469930 -0.2081315397
[56] -0.1599823073 0.6296111043 -0.3997890472 -0.4222270231 -0.4437277840
[61] 0.2039737043 0.9671317654 -0.0134416953 -2.3033685364 0.0087641883
[66] 1.3075420827 -1.6777091464 -0.3191070024 2.0842670044 0.3991175770
[71] 1.3352611275 -1.2310292187 -1.1890809401 1.2364581274 0.2959005287
[76] -0.5452923959 0.2327399173 -1.2188189989 -0.5611518991 -2.1993686817
[81] 0.0485511582 0.3232029685 -0.9567371164 1.4500181895 -1.2112621299
[86] -0.1512687748 1.3530858302 -1.2907413567 -1.0077154000 0.0845998325
[91] -1.5406579388 0.0260577236 -0.6801216759 -1.1139841587 -0.0009720163
[96] -0.2061212840 0.4039955785 -1.0295513406 -1.2841992806 2.5027653007
> colSums(tmp)
[1] -0.4513459190 0.7058436977 -1.8482978010 0.4115979761 0.9804038606
[6] 0.8588039470 0.9458366053 -1.6256720924 -2.1668210933 -1.0201350504
[11] 1.4333260010 -0.3471372689 -1.5657653991 0.2599744672 0.1975237752
[16] -0.3565775985 0.7851591794 -0.2941426513 -1.4243592320 -0.6374372443
[21] -1.3414624845 -0.2863120634 0.0968957448 -0.7558123132 -0.4057970338
[26] 0.3076045899 -1.3005702656 -1.9521376650 -0.1925081546 0.1863755098
[31] 0.0136494369 -1.2741585970 0.1885122560 1.0437396801 -1.0962511368
[36] -1.1024941845 -0.6685106325 -0.0163152138 -1.4634988251 0.3966661271
[41] 0.0088651126 1.3180590386 0.7313883122 -0.5329600997 0.1377411124
[46] 1.1872828745 0.0653856932 -0.3840682784 0.8852027761 0.6670487159
[51] -0.9272430062 -1.0587966927 0.5715833804 -0.1751469930 -0.2081315397
[56] -0.1599823073 0.6296111043 -0.3997890472 -0.4222270231 -0.4437277840
[61] 0.2039737043 0.9671317654 -0.0134416953 -2.3033685364 0.0087641883
[66] 1.3075420827 -1.6777091464 -0.3191070024 2.0842670044 0.3991175770
[71] 1.3352611275 -1.2310292187 -1.1890809401 1.2364581274 0.2959005287
[76] -0.5452923959 0.2327399173 -1.2188189989 -0.5611518991 -2.1993686817
[81] 0.0485511582 0.3232029685 -0.9567371164 1.4500181895 -1.2112621299
[86] -0.1512687748 1.3530858302 -1.2907413567 -1.0077154000 0.0845998325
[91] -1.5406579388 0.0260577236 -0.6801216759 -1.1139841587 -0.0009720163
[96] -0.2061212840 0.4039955785 -1.0295513406 -1.2841992806 2.5027653007
> 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.4513459190 0.7058436977 -1.8482978010 0.4115979761 0.9804038606
[6] 0.8588039470 0.9458366053 -1.6256720924 -2.1668210933 -1.0201350504
[11] 1.4333260010 -0.3471372689 -1.5657653991 0.2599744672 0.1975237752
[16] -0.3565775985 0.7851591794 -0.2941426513 -1.4243592320 -0.6374372443
[21] -1.3414624845 -0.2863120634 0.0968957448 -0.7558123132 -0.4057970338
[26] 0.3076045899 -1.3005702656 -1.9521376650 -0.1925081546 0.1863755098
[31] 0.0136494369 -1.2741585970 0.1885122560 1.0437396801 -1.0962511368
[36] -1.1024941845 -0.6685106325 -0.0163152138 -1.4634988251 0.3966661271
[41] 0.0088651126 1.3180590386 0.7313883122 -0.5329600997 0.1377411124
[46] 1.1872828745 0.0653856932 -0.3840682784 0.8852027761 0.6670487159
[51] -0.9272430062 -1.0587966927 0.5715833804 -0.1751469930 -0.2081315397
[56] -0.1599823073 0.6296111043 -0.3997890472 -0.4222270231 -0.4437277840
[61] 0.2039737043 0.9671317654 -0.0134416953 -2.3033685364 0.0087641883
[66] 1.3075420827 -1.6777091464 -0.3191070024 2.0842670044 0.3991175770
[71] 1.3352611275 -1.2310292187 -1.1890809401 1.2364581274 0.2959005287
[76] -0.5452923959 0.2327399173 -1.2188189989 -0.5611518991 -2.1993686817
[81] 0.0485511582 0.3232029685 -0.9567371164 1.4500181895 -1.2112621299
[86] -0.1512687748 1.3530858302 -1.2907413567 -1.0077154000 0.0845998325
[91] -1.5406579388 0.0260577236 -0.6801216759 -1.1139841587 -0.0009720163
[96] -0.2061212840 0.4039955785 -1.0295513406 -1.2841992806 2.5027653007
> colMin(tmp)
[1] -0.4513459190 0.7058436977 -1.8482978010 0.4115979761 0.9804038606
[6] 0.8588039470 0.9458366053 -1.6256720924 -2.1668210933 -1.0201350504
[11] 1.4333260010 -0.3471372689 -1.5657653991 0.2599744672 0.1975237752
[16] -0.3565775985 0.7851591794 -0.2941426513 -1.4243592320 -0.6374372443
[21] -1.3414624845 -0.2863120634 0.0968957448 -0.7558123132 -0.4057970338
[26] 0.3076045899 -1.3005702656 -1.9521376650 -0.1925081546 0.1863755098
[31] 0.0136494369 -1.2741585970 0.1885122560 1.0437396801 -1.0962511368
[36] -1.1024941845 -0.6685106325 -0.0163152138 -1.4634988251 0.3966661271
[41] 0.0088651126 1.3180590386 0.7313883122 -0.5329600997 0.1377411124
[46] 1.1872828745 0.0653856932 -0.3840682784 0.8852027761 0.6670487159
[51] -0.9272430062 -1.0587966927 0.5715833804 -0.1751469930 -0.2081315397
[56] -0.1599823073 0.6296111043 -0.3997890472 -0.4222270231 -0.4437277840
[61] 0.2039737043 0.9671317654 -0.0134416953 -2.3033685364 0.0087641883
[66] 1.3075420827 -1.6777091464 -0.3191070024 2.0842670044 0.3991175770
[71] 1.3352611275 -1.2310292187 -1.1890809401 1.2364581274 0.2959005287
[76] -0.5452923959 0.2327399173 -1.2188189989 -0.5611518991 -2.1993686817
[81] 0.0485511582 0.3232029685 -0.9567371164 1.4500181895 -1.2112621299
[86] -0.1512687748 1.3530858302 -1.2907413567 -1.0077154000 0.0845998325
[91] -1.5406579388 0.0260577236 -0.6801216759 -1.1139841587 -0.0009720163
[96] -0.2061212840 0.4039955785 -1.0295513406 -1.2841992806 2.5027653007
> colMedians(tmp)
[1] -0.4513459190 0.7058436977 -1.8482978010 0.4115979761 0.9804038606
[6] 0.8588039470 0.9458366053 -1.6256720924 -2.1668210933 -1.0201350504
[11] 1.4333260010 -0.3471372689 -1.5657653991 0.2599744672 0.1975237752
[16] -0.3565775985 0.7851591794 -0.2941426513 -1.4243592320 -0.6374372443
[21] -1.3414624845 -0.2863120634 0.0968957448 -0.7558123132 -0.4057970338
[26] 0.3076045899 -1.3005702656 -1.9521376650 -0.1925081546 0.1863755098
[31] 0.0136494369 -1.2741585970 0.1885122560 1.0437396801 -1.0962511368
[36] -1.1024941845 -0.6685106325 -0.0163152138 -1.4634988251 0.3966661271
[41] 0.0088651126 1.3180590386 0.7313883122 -0.5329600997 0.1377411124
[46] 1.1872828745 0.0653856932 -0.3840682784 0.8852027761 0.6670487159
[51] -0.9272430062 -1.0587966927 0.5715833804 -0.1751469930 -0.2081315397
[56] -0.1599823073 0.6296111043 -0.3997890472 -0.4222270231 -0.4437277840
[61] 0.2039737043 0.9671317654 -0.0134416953 -2.3033685364 0.0087641883
[66] 1.3075420827 -1.6777091464 -0.3191070024 2.0842670044 0.3991175770
[71] 1.3352611275 -1.2310292187 -1.1890809401 1.2364581274 0.2959005287
[76] -0.5452923959 0.2327399173 -1.2188189989 -0.5611518991 -2.1993686817
[81] 0.0485511582 0.3232029685 -0.9567371164 1.4500181895 -1.2112621299
[86] -0.1512687748 1.3530858302 -1.2907413567 -1.0077154000 0.0845998325
[91] -1.5406579388 0.0260577236 -0.6801216759 -1.1139841587 -0.0009720163
[96] -0.2061212840 0.4039955785 -1.0295513406 -1.2841992806 2.5027653007
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.4513459 0.7058437 -1.848298 0.411598 0.9804039 0.8588039 0.9458366
[2,] -0.4513459 0.7058437 -1.848298 0.411598 0.9804039 0.8588039 0.9458366
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -1.625672 -2.166821 -1.020135 1.433326 -0.3471373 -1.565765 0.2599745
[2,] -1.625672 -2.166821 -1.020135 1.433326 -0.3471373 -1.565765 0.2599745
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.1975238 -0.3565776 0.7851592 -0.2941427 -1.424359 -0.6374372 -1.341462
[2,] 0.1975238 -0.3565776 0.7851592 -0.2941427 -1.424359 -0.6374372 -1.341462
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.2863121 0.09689574 -0.7558123 -0.405797 0.3076046 -1.30057 -1.952138
[2,] -0.2863121 0.09689574 -0.7558123 -0.405797 0.3076046 -1.30057 -1.952138
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -0.1925082 0.1863755 0.01364944 -1.274159 0.1885123 1.04374 -1.096251
[2,] -0.1925082 0.1863755 0.01364944 -1.274159 0.1885123 1.04374 -1.096251
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -1.102494 -0.6685106 -0.01631521 -1.463499 0.3966661 0.008865113 1.318059
[2,] -1.102494 -0.6685106 -0.01631521 -1.463499 0.3966661 0.008865113 1.318059
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.7313883 -0.5329601 0.1377411 1.187283 0.06538569 -0.3840683 0.8852028
[2,] 0.7313883 -0.5329601 0.1377411 1.187283 0.06538569 -0.3840683 0.8852028
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.6670487 -0.927243 -1.058797 0.5715834 -0.175147 -0.2081315 -0.1599823
[2,] 0.6670487 -0.927243 -1.058797 0.5715834 -0.175147 -0.2081315 -0.1599823
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.6296111 -0.399789 -0.422227 -0.4437278 0.2039737 0.9671318 -0.0134417
[2,] 0.6296111 -0.399789 -0.422227 -0.4437278 0.2039737 0.9671318 -0.0134417
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -2.303369 0.008764188 1.307542 -1.677709 -0.319107 2.084267 0.3991176
[2,] -2.303369 0.008764188 1.307542 -1.677709 -0.319107 2.084267 0.3991176
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 1.335261 -1.231029 -1.189081 1.236458 0.2959005 -0.5452924 0.2327399
[2,] 1.335261 -1.231029 -1.189081 1.236458 0.2959005 -0.5452924 0.2327399
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -1.218819 -0.5611519 -2.199369 0.04855116 0.323203 -0.9567371 1.450018
[2,] -1.218819 -0.5611519 -2.199369 0.04855116 0.323203 -0.9567371 1.450018
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -1.211262 -0.1512688 1.353086 -1.290741 -1.007715 0.08459983 -1.540658
[2,] -1.211262 -0.1512688 1.353086 -1.290741 -1.007715 0.08459983 -1.540658
[,92] [,93] [,94] [,95] [,96] [,97]
[1,] 0.02605772 -0.6801217 -1.113984 -0.0009720163 -0.2061213 0.4039956
[2,] 0.02605772 -0.6801217 -1.113984 -0.0009720163 -0.2061213 0.4039956
[,98] [,99] [,100]
[1,] -1.029551 -1.284199 2.502765
[2,] -1.029551 -1.284199 2.502765
>
>
> Max(tmp2)
[1] 4.1584
> Min(tmp2)
[1] -3.66543
> mean(tmp2)
[1] 0.05414988
> Sum(tmp2)
[1] 5.414988
> Var(tmp2)
[1] 1.000964
>
> rowMeans(tmp2)
[1] 1.45670667 -1.23832195 -0.26220012 0.26685589 0.07766190 -0.48954514
[7] 0.09732799 -0.89800570 -0.35867870 0.38320191 0.92442932 0.72757969
[13] -0.29563160 -1.44233759 -1.52727510 0.69185187 -0.23752123 1.97135330
[19] -1.25033786 -0.02021103 -0.03402031 0.80310758 0.53217569 -0.07850816
[25] 0.25051739 -0.07605238 0.51382358 0.31393098 0.19186456 -1.37756434
[31] -3.66543008 -1.06671081 -0.67804918 4.15840022 -0.07333890 -0.07362571
[37] 1.03871858 1.49044049 0.10872192 1.17626408 0.45856479 0.40860719
[43] -0.33561711 0.50579301 1.52063816 0.58940001 1.56875518 0.70760672
[49] 0.06280082 -0.34536729 0.29300516 2.23144588 -0.90643680 -0.74146014
[55] 0.11363824 -1.29706644 -0.05567947 -1.51292267 -1.02230286 0.90641535
[61] -1.03000818 0.66088023 1.01739644 0.98543876 -0.21556750 0.36917456
[67] 0.11561755 -0.43591745 0.69767793 -1.66861862 0.69866335 -0.41203893
[73] 0.18052291 0.88354154 -0.97647239 1.52115900 -1.00164661 -1.15887442
[79] -0.59990705 0.41193891 -0.80102119 0.06079291 -0.88890023 0.05263724
[85] -0.08439891 0.23206150 -0.46820974 0.82909009 -1.56943502 0.88257420
[91] 0.11620410 0.58850175 0.29774358 0.98528718 -0.73559770 0.45520172
[97] 0.65770925 -0.44818072 -0.14071784 0.16930038
> rowSums(tmp2)
[1] 1.45670667 -1.23832195 -0.26220012 0.26685589 0.07766190 -0.48954514
[7] 0.09732799 -0.89800570 -0.35867870 0.38320191 0.92442932 0.72757969
[13] -0.29563160 -1.44233759 -1.52727510 0.69185187 -0.23752123 1.97135330
[19] -1.25033786 -0.02021103 -0.03402031 0.80310758 0.53217569 -0.07850816
[25] 0.25051739 -0.07605238 0.51382358 0.31393098 0.19186456 -1.37756434
[31] -3.66543008 -1.06671081 -0.67804918 4.15840022 -0.07333890 -0.07362571
[37] 1.03871858 1.49044049 0.10872192 1.17626408 0.45856479 0.40860719
[43] -0.33561711 0.50579301 1.52063816 0.58940001 1.56875518 0.70760672
[49] 0.06280082 -0.34536729 0.29300516 2.23144588 -0.90643680 -0.74146014
[55] 0.11363824 -1.29706644 -0.05567947 -1.51292267 -1.02230286 0.90641535
[61] -1.03000818 0.66088023 1.01739644 0.98543876 -0.21556750 0.36917456
[67] 0.11561755 -0.43591745 0.69767793 -1.66861862 0.69866335 -0.41203893
[73] 0.18052291 0.88354154 -0.97647239 1.52115900 -1.00164661 -1.15887442
[79] -0.59990705 0.41193891 -0.80102119 0.06079291 -0.88890023 0.05263724
[85] -0.08439891 0.23206150 -0.46820974 0.82909009 -1.56943502 0.88257420
[91] 0.11620410 0.58850175 0.29774358 0.98528718 -0.73559770 0.45520172
[97] 0.65770925 -0.44818072 -0.14071784 0.16930038
> 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] 1.45670667 -1.23832195 -0.26220012 0.26685589 0.07766190 -0.48954514
[7] 0.09732799 -0.89800570 -0.35867870 0.38320191 0.92442932 0.72757969
[13] -0.29563160 -1.44233759 -1.52727510 0.69185187 -0.23752123 1.97135330
[19] -1.25033786 -0.02021103 -0.03402031 0.80310758 0.53217569 -0.07850816
[25] 0.25051739 -0.07605238 0.51382358 0.31393098 0.19186456 -1.37756434
[31] -3.66543008 -1.06671081 -0.67804918 4.15840022 -0.07333890 -0.07362571
[37] 1.03871858 1.49044049 0.10872192 1.17626408 0.45856479 0.40860719
[43] -0.33561711 0.50579301 1.52063816 0.58940001 1.56875518 0.70760672
[49] 0.06280082 -0.34536729 0.29300516 2.23144588 -0.90643680 -0.74146014
[55] 0.11363824 -1.29706644 -0.05567947 -1.51292267 -1.02230286 0.90641535
[61] -1.03000818 0.66088023 1.01739644 0.98543876 -0.21556750 0.36917456
[67] 0.11561755 -0.43591745 0.69767793 -1.66861862 0.69866335 -0.41203893
[73] 0.18052291 0.88354154 -0.97647239 1.52115900 -1.00164661 -1.15887442
[79] -0.59990705 0.41193891 -0.80102119 0.06079291 -0.88890023 0.05263724
[85] -0.08439891 0.23206150 -0.46820974 0.82909009 -1.56943502 0.88257420
[91] 0.11620410 0.58850175 0.29774358 0.98528718 -0.73559770 0.45520172
[97] 0.65770925 -0.44818072 -0.14071784 0.16930038
> rowMin(tmp2)
[1] 1.45670667 -1.23832195 -0.26220012 0.26685589 0.07766190 -0.48954514
[7] 0.09732799 -0.89800570 -0.35867870 0.38320191 0.92442932 0.72757969
[13] -0.29563160 -1.44233759 -1.52727510 0.69185187 -0.23752123 1.97135330
[19] -1.25033786 -0.02021103 -0.03402031 0.80310758 0.53217569 -0.07850816
[25] 0.25051739 -0.07605238 0.51382358 0.31393098 0.19186456 -1.37756434
[31] -3.66543008 -1.06671081 -0.67804918 4.15840022 -0.07333890 -0.07362571
[37] 1.03871858 1.49044049 0.10872192 1.17626408 0.45856479 0.40860719
[43] -0.33561711 0.50579301 1.52063816 0.58940001 1.56875518 0.70760672
[49] 0.06280082 -0.34536729 0.29300516 2.23144588 -0.90643680 -0.74146014
[55] 0.11363824 -1.29706644 -0.05567947 -1.51292267 -1.02230286 0.90641535
[61] -1.03000818 0.66088023 1.01739644 0.98543876 -0.21556750 0.36917456
[67] 0.11561755 -0.43591745 0.69767793 -1.66861862 0.69866335 -0.41203893
[73] 0.18052291 0.88354154 -0.97647239 1.52115900 -1.00164661 -1.15887442
[79] -0.59990705 0.41193891 -0.80102119 0.06079291 -0.88890023 0.05263724
[85] -0.08439891 0.23206150 -0.46820974 0.82909009 -1.56943502 0.88257420
[91] 0.11620410 0.58850175 0.29774358 0.98528718 -0.73559770 0.45520172
[97] 0.65770925 -0.44818072 -0.14071784 0.16930038
>
> colMeans(tmp2)
[1] 0.05414988
> colSums(tmp2)
[1] 5.414988
> colVars(tmp2)
[1] 1.000964
> colSd(tmp2)
[1] 1.000482
> colMax(tmp2)
[1] 4.1584
> colMin(tmp2)
[1] -3.66543
> colMedians(tmp2)
[1] 0.103025
> colRanges(tmp2)
[,1]
[1,] -3.66543
[2,] 4.15840
>
> 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.3668452 -4.1740156 -0.3149860 -3.1721980 0.3938155 3.1463483
[7] 3.4545400 -4.2894388 0.5466714 -1.6840506
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.9626257
[2,] -0.6544952
[3,] -0.1550132
[4,] 1.1926177
[5,] 2.2580173
>
> rowApply(tmp,sum)
[1] 0.04064713 1.53920341 -3.38513740 -0.60884739 -3.15516388 -1.56261658
[7] 0.46064958 4.67997294 -2.25043394 -0.48474259
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 4 10 4 3 10 9 1 9 3 3
[2,] 3 2 3 1 9 4 7 2 4 10
[3,] 9 3 5 2 8 6 3 7 8 5
[4,] 5 4 6 9 4 1 9 1 9 2
[5,] 10 7 10 8 2 10 4 4 5 1
[6,] 6 9 7 5 6 8 6 10 1 6
[7,] 1 5 9 10 7 7 8 6 7 8
[8,] 7 8 1 6 3 3 2 5 2 9
[9,] 2 6 8 4 1 5 5 8 10 7
[10,] 8 1 2 7 5 2 10 3 6 4
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] -1.12019094 0.36333815 4.02290346 -1.82392621 -0.09672638 0.12640195
[7] -2.37226877 0.72052764 1.73951287 -2.74033511 -2.54292923 -0.96228055
[13] 1.44384366 -4.15040635 -0.70420956 -1.04206237 0.48606759 1.96591072
[19] -1.66033546 2.39671082
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.3448411
[2,] -0.6573813
[3,] -0.2924016
[4,] 0.3570849
[5,] 0.8173481
>
> rowApply(tmp,sum)
[1] -1.224878 5.135461 -5.790259 -1.736302 -2.334476
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 11 15 9 8 2
[2,] 16 12 18 3 9
[3,] 9 20 19 11 15
[4,] 5 2 11 9 16
[5,] 18 7 1 18 7
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.3570849 0.9760625 0.2003739 -0.9092514 1.1052485 1.0099107
[2,] 0.8173481 0.2763488 2.4637071 -1.0670125 -0.3033049 -0.6318345
[3,] -0.2924016 0.6771472 1.1368205 -0.1875926 -1.8151613 0.2039389
[4,] -0.6573813 -1.3858783 -0.1308243 -0.2294879 1.5597092 0.3677789
[5,] -1.3448411 -0.1803421 0.3528262 0.5694182 -0.6432179 -0.8233920
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.6275094 0.83862337 0.2832565 -3.9079076 0.6587988 -1.4580147
[2,] -0.4833299 0.34378707 1.2036520 0.1061586 -2.0225129 1.4225882
[3,] -1.2017335 0.41612067 0.1857258 2.1427094 -0.1818223 -1.2424124
[4,] 0.3884794 -0.89560058 -1.2640242 -1.3869476 -1.2027748 0.4951374
[5,] -0.4481754 0.01759711 1.3309028 0.3056521 0.2053820 -0.1795791
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 1.63061134 -1.7967326 1.67878922 -0.2658724 0.55977287 0.3654087
[2,] 0.22696820 1.5215979 -0.33352761 0.2746132 -0.47288724 1.4283251
[3,] -1.62633766 -1.0875702 0.03142705 -0.7135984 -0.04770441 -0.5592075
[4,] -0.05638595 -2.0527699 -0.90058972 1.9688517 -0.13493630 0.5679725
[5,] 1.26898773 -0.7349316 -1.18030850 -2.3060566 0.58182267 0.1634119
[,19] [,20]
[1,] -0.8425654 -1.080965696
[2,] 0.3625938 0.002182719
[3,] -1.3537238 -0.274883117
[4,] 0.9949431 2.218426326
[5,] -0.8215830 1.531950592
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 800 bytes.
>
>
>
> subBufferedMatrix(tmp,1:5,1:5)
BufferedMatrix object
Matrix size: 5 5
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 651 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 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.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 1.187562 -0.1482833 0.5270975 -0.4770158 1.229963 -0.156982 -0.6763929
col8 col9 col10 col11 col12 col13 col14
row1 0.08611634 -1.20818 -0.4699955 -0.186151 -0.8757517 1.419919 -0.01319815
col15 col16 col17 col18 col19 col20
row1 0.3325902 -0.1435268 -0.6801297 -0.8800394 -0.6113697 -0.9050935
> tmp[,"col10"]
col10
row1 -0.4699955
row2 -0.5101180
row3 -1.2444046
row4 -0.2923781
row5 -1.7446334
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 1.187562 -0.1482833 0.5270975 -0.4770158 1.2299634 -0.1569820 -0.6763929
row5 -1.272610 -0.4331226 -0.4515506 0.3995332 0.9151638 0.3028421 -2.2182931
col8 col9 col10 col11 col12 col13 col14
row1 0.08611634 -1.2081799 -0.4699955 -0.186151 -0.8757517 1.419919 -0.01319815
row5 0.20118637 0.4258008 -1.7446334 -1.418265 -1.3128421 1.251933 0.57962055
col15 col16 col17 col18 col19 col20
row1 0.3325902 -0.1435268 -0.6801297 -0.8800394 -0.61136972 -0.9050935
row5 -0.1630239 0.2733601 -1.8246137 0.1540070 0.01001247 -0.3046335
> tmp[,c("col6","col20")]
col6 col20
row1 -0.1569820 -0.90509355
row2 -0.9260267 0.64301405
row3 -1.0691967 -0.17571455
row4 1.4044907 0.08977226
row5 0.3028421 -0.30463347
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.1569820 -0.9050935
row5 0.3028421 -0.3046335
>
>
>
>
> 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 52.15538 49.42385 49.47545 49.81027 50.05698 105.7043 48.84015 49.99581
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.01798 50.29859 50.48741 50.29821 51.32974 50.9015 49.66863 48.99009
col17 col18 col19 col20
row1 51.53496 49.55495 50.91217 106.08
> tmp[,"col10"]
col10
row1 50.29859
row2 28.87227
row3 30.38123
row4 28.62542
row5 50.33475
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 52.15538 49.42385 49.47545 49.81027 50.05698 105.7043 48.84015 49.99581
row5 50.12531 51.50236 47.86841 49.55948 49.47367 106.2496 50.98486 50.62003
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.01798 50.29859 50.48741 50.29821 51.32974 50.90150 49.66863 48.99009
row5 48.13627 50.33475 49.67927 49.44867 49.69019 51.31833 49.43566 49.95042
col17 col18 col19 col20
row1 51.53496 49.55495 50.91217 106.0800
row5 49.60653 49.78212 52.23113 103.4131
> tmp[,c("col6","col20")]
col6 col20
row1 105.70430 106.08004
row2 75.53729 74.53993
row3 76.07564 73.67710
row4 73.86678 73.62085
row5 106.24959 103.41314
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.7043 106.0800
row5 106.2496 103.4131
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.7043 106.0800
row5 106.2496 103.4131
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 1.6169749
[2,] -0.4412306
[3,] 0.1713205
[4,] 1.0999159
[5,] -0.1286210
> tmp[,c("col17","col7")]
col17 col7
[1,] 1.17674509 -0.5940657
[2,] -0.03749119 1.8851458
[3,] 0.69338060 1.0664164
[4,] -0.87911905 1.2269432
[5,] -1.09277006 -0.6877787
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.08183236 -0.4540721
[2,] 0.85975606 0.5319379
[3,] 0.13756682 1.1907510
[4,] 0.38183349 0.1670834
[5,] -0.17858292 0.8178784
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.08183236
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.08183236
[2,] 0.85975606
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row3 -0.4729188 -1.625232 0.5598228 0.4999326 -0.4686921 -0.9052419 1.266698
row1 1.3383266 -1.574624 1.6913132 0.2326645 0.4094532 -0.2192057 -1.433461
[,8] [,9] [,10] [,11] [,12] [,13]
row3 -0.5668105 0.7471025 0.4344456 -0.4511289 -0.69150846 -0.4213870
row1 -0.6117869 -0.1380779 0.3820073 -0.5333948 0.04674602 0.1688086
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row3 0.5869142 -0.1304237 0.4289000 1.714978 0.423767887 0.185927 0.9520739
row1 2.1011641 -0.6098338 0.9299977 -0.867097 -0.003918369 1.799899 0.1407644
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.14901 -0.4706223 0.4738479 -0.2086472 -0.3237672 -2.20734 -0.2561184
[,8] [,9] [,10]
row2 0.5823298 1.802262 0.003808159
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.9344229 -0.6666013 0.2872504 -0.5955257 0.1035907 0.6452714 -2.674775
[,8] [,9] [,10] [,11] [,12] [,13]
row5 -0.08117419 -1.068237 0.3787669 -1.279216 -0.3455009 -0.09356636
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.6744334 1.023061 -1.549873 1.614763 -1.812694 -0.5671445 -0.9202876
>
>
> 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: 0x6326aebfa840>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d61f46dcf2cd1"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d61f45666fffa"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d61f44967d906"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d61f4395b453f"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d61f430c308bd"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d61f4638b3dcd"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d61f433c20cc0"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d61f461b8febc"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d61f4572aa1a2"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d61f43b08712"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d61f467863c85"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d61f4478a9919"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d61f4668d92c4"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d61f422f2a545"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d61f462a9db66"
>
>
> ### 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: 0x6326ad517bb0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x6326ad517bb0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x6326ad517bb0>
> rowMedians(tmp)
[1] -0.574813494 -0.256389030 0.412854281 -0.062521687 -0.145301612
[6] 0.313559208 -0.400150026 -0.318462323 -0.008995540 0.440794346
[11] 0.014244248 0.245737929 0.408561669 -0.060141218 -0.009303269
[16] 0.204792795 -0.059044373 0.370130326 -0.163451732 0.137374217
[21] 0.469930160 0.301103502 0.365964429 -0.072626286 0.102282910
[26] 0.107395872 -0.011204977 -0.543634727 0.053017212 -0.199354097
[31] -0.085268639 -0.056116569 -0.273650206 0.621088959 -0.362301830
[36] -0.594589691 0.358395285 0.117304861 0.247688330 0.283937417
[41] 0.012971686 -0.056472900 -0.725338720 0.120640736 -0.514147099
[46] -0.183487215 -0.472101109 0.236129792 -0.255831989 0.275906496
[51] 0.072050629 0.217008611 -0.289690531 -0.353314848 0.252854576
[56] 0.234181400 -0.006128633 0.172913520 -0.185051178 0.047698463
[61] -0.359630150 0.366039745 -0.080496934 0.132961205 0.232958401
[66] 0.529107831 -0.225501874 0.127801842 0.830071325 -0.519230901
[71] -0.045461061 -0.081587414 0.158250168 0.349230167 0.026104768
[76] 0.121213074 0.105208812 0.124672513 -0.217983167 0.817025367
[81] -0.290203782 -0.223454532 -0.060383045 0.229592569 -0.096819450
[86] 0.195978281 -0.174845165 -0.029634030 0.212884311 0.168438584
[91] -0.340615196 -0.287456352 0.048965849 -0.292394870 -0.952298152
[96] 0.006371762 -0.050051046 -0.612702086 -0.151405515 0.133950871
[101] -0.163444181 -0.788270756 -0.263753103 0.212612721 0.134508725
[106] 0.241412058 0.081805835 -0.216830041 -0.144046337 0.666354404
[111] 0.462554276 0.023586508 -0.701841513 0.344837098 0.333267951
[116] 0.026472098 -0.601482285 -0.231507064 0.208063977 0.028839785
[121] -0.137490597 -0.291154215 -0.382736851 0.228663459 0.053562442
[126] -0.132255919 -0.129423492 0.058562623 -0.234014233 0.139682841
[131] -0.332992214 0.026333886 -0.237283017 0.557248713 0.298705057
[136] -0.568471742 -0.188999435 0.338005238 0.198696269 -0.071540794
[141] 0.554341747 -0.327523271 -0.314445274 0.543589573 -0.150578193
[146] 0.162789083 -0.025121063 -0.258613010 -0.001288013 0.382007556
[151] 0.169280633 -0.098389477 0.125901687 0.136459272 -0.100339909
[156] 0.328911266 0.139957949 -0.474159538 0.407323925 0.165407512
[161] -0.046749904 -0.567204040 -0.270746001 -0.199062552 0.264604721
[166] -0.285267246 0.191673220 0.065386537 0.061820301 -0.379580001
[171] 0.157842068 0.146064649 -0.133844725 -0.258918826 -0.195053813
[176] -0.289586909 -0.681768192 0.161238299 0.048339899 0.001635042
[181] 0.334072111 0.088235130 -0.411954114 0.422842399 0.798747579
[186] 0.111683287 0.184654344 -0.064452113 0.206830780 0.052633530
[191] -0.211760651 0.210981623 -0.666521405 -0.357333314 0.517434332
[196] -0.151274740 0.133665209 0.025568376 0.388056950 0.573406262
[201] 0.295467060 -0.555532063 0.455301476 -0.004842882 -0.252116372
[206] -0.075695237 0.539786221 -0.247884496 -0.039414960 -0.305693459
[211] -0.054418788 -0.563572714 0.076818433 0.513892429 -0.297602662
[216] 0.677532976 -0.026249771 -0.137334546 -0.142227962 -0.130825729
[221] 0.149750750 -0.723568875 -0.093397507 0.412762185 -0.412164268
[226] -0.095679673 0.107969411 -0.599945325 0.123264639 -0.319107733
>
> proc.time()
user system elapsed
1.337 1.470 2.794
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> prefix <- "dbmtest"
> directory <- getwd()
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x60ae11653c10>
> .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: 0x60ae11653c10>
> .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: 0x60ae11653c10>
> .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: 0x60ae11653c10>
> 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: 0x60ae123162d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60ae123162d0>
> .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: 0x60ae123162d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60ae123162d0>
> .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: 0x60ae123162d0>
> 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: 0x60ae129ebd70>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60ae129ebd70>
> .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: 0x60ae129ebd70>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60ae129ebd70>
> .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: 0x60ae129ebd70>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x60ae129ebd70>
> .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: 0x60ae129ebd70>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x60ae129ebd70>
> .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: 0x60ae129ebd70>
> 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: 0x60ae1255f370>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x60ae1255f370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60ae1255f370>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60ae1255f370>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1d63e1379d6d5" "BufferedMatrixFile1d63e14742ac12"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1d63e1379d6d5" "BufferedMatrixFile1d63e14742ac12"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x60ae124aaff0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60ae124aaff0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60ae124aaff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x60ae124aaff0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x60ae124aaff0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x60ae124aaff0>
> .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: 0x60ae1268d3d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x60ae1268d3d0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x60ae1268d3d0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x60ae1268d3d0>
> 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: 0x60ae13e3efb0>
> .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: 0x60ae13e3efb0>
> rm(P)
>
> proc.time()
user system elapsed
0.254 0.059 0.301
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> Temp <- createBufferedMatrix(100)
> dim(Temp)
[1] 100 0
> buffer.dim(Temp)
[1] 1 1
>
>
> proc.time()
user system elapsed
0.242 0.047 0.275