| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-03-19 11:33 -0400 (Thu, 19 Mar 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences" | 4858 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2026-03-01 r89506) -- "Unsuffered Consequences" | 4060 |
| Click on any hostname to see more info about the system (e.g. compilers) (*) as reported by 'uname -p', except on Windows and Mac OS X | ||||
| Package 257/2368 | 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 | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | ERROR | ERROR | skipped | skipped | |||||||||
| 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-03-18 21:59:15 -0400 (Wed, 18 Mar 2026) |
| EndedAt: 2026-03-18 21:59:40 -0400 (Wed, 18 Mar 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-03-05 r89546)
* 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.4 LTS
* using session charset: UTF-8
* current time: 2026-03-19 01:59:15 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.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.1) 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-03-05 r89546) -- "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.245 0.057 0.288
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2026-03-05 r89546) -- "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 479482 25.7 1050322 56.1 639251 34.2
Vcells 886403 6.8 8388608 64.0 2083267 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 Mar 18 21:59:30 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 Mar 18 21:59:30 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: 0x5e92435414f0>
>
>
>
> 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 Mar 18 21:59:31 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 Mar 18 21:59:31 2026"
>
> ColMode(tmp2)
<pointer: 0x5e92435414f0>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 101.03123435 -0.1378771 -0.01821573 -0.8055412
[2,] 0.09245334 0.1876897 -0.29175982 0.9493702
[3,] 0.97822176 -0.4679154 -0.21818593 0.4675429
[4,] -2.31385671 0.0559604 -0.95199670 1.0125864
> 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,] 101.03123435 0.1378771 0.01821573 0.8055412
[2,] 0.09245334 0.1876897 0.29175982 0.9493702
[3,] 0.97822176 0.4679154 0.21818593 0.4675429
[4,] 2.31385671 0.0559604 0.95199670 1.0125864
> 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.0514295 0.3713181 0.1349657 0.8975195
[2,] 0.3040614 0.4332317 0.5401480 0.9743563
[3,] 0.9890509 0.6840434 0.4671038 0.6837711
[4,] 1.5211367 0.2365595 0.9757032 1.0062735
>
> 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,] 226.54553 28.85106 26.36787 34.78074
[2,] 28.13307 29.52001 30.69324 35.69293
[3,] 35.86873 32.30835 29.88922 32.30525
[4,] 42.52522 27.42156 35.70903 36.07532
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5e9243ef1aa0>
> exp(tmp5)
<pointer: 0x5e9243ef1aa0>
> log(tmp5,2)
<pointer: 0x5e9243ef1aa0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.5248
> Min(tmp5)
[1] 54.60911
> mean(tmp5)
[1] 73.32611
> Sum(tmp5)
[1] 14665.22
> Var(tmp5)
[1] 875.1369
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.55538 71.07396 70.25903 72.76019 71.84782 71.75692 73.38105 71.25080
[9] 70.59914 69.77682
> rowSums(tmp5)
[1] 1811.108 1421.479 1405.181 1455.204 1436.956 1435.138 1467.621 1425.016
[9] 1411.983 1395.536
> rowVars(tmp5)
[1] 8081.45041 67.77681 42.61359 69.83603 69.88472 117.72383
[7] 85.46480 118.91701 66.23329 87.43969
> rowSd(tmp5)
[1] 89.896888 8.232667 6.527908 8.356795 8.359708 10.850061 9.244718
[8] 10.904908 8.138384 9.350919
> rowMax(tmp5)
[1] 471.52484 81.54697 84.96745 88.51068 86.22953 93.96792 86.29377
[8] 92.58553 90.94888 89.67082
> rowMin(tmp5)
[1] 54.88127 58.55529 60.81256 57.07438 58.27011 58.72737 54.60911 56.70314
[9] 57.40673 54.70891
>
> colMeans(tmp5)
[1] 110.36580 70.24559 65.95809 69.10362 66.48730 65.36635 72.26207
[8] 77.12443 70.78671 72.34465 71.47651 71.37868 74.29893 72.67678
[15] 72.45572 72.49514 77.19782 74.09808 69.61867 70.78129
> colSums(tmp5)
[1] 1103.6580 702.4559 659.5809 691.0362 664.8730 653.6635 722.6207
[8] 771.2443 707.8671 723.4465 714.7651 713.7868 742.9893 726.7678
[15] 724.5572 724.9514 771.9782 740.9808 696.1867 707.8129
> colVars(tmp5)
[1] 16228.70980 92.20822 31.34108 51.68944 53.07143 58.73294
[7] 127.44256 75.25759 74.50376 67.33275 29.44549 72.63194
[13] 93.34202 48.56056 37.01287 112.65395 52.64412 44.95250
[19] 70.92754 113.92090
> colSd(tmp5)
[1] 127.391953 9.602511 5.598311 7.189537 7.285014 7.663742
[7] 11.289046 8.675113 8.631556 8.205654 5.426370 8.522438
[13] 9.661367 6.968540 6.083820 10.613856 7.255627 6.704662
[19] 8.421849 10.673374
> colMax(tmp5)
[1] 471.52484 84.47354 74.32366 75.14231 76.05807 77.47249 92.58553
[8] 93.96792 86.29377 86.69050 77.66422 85.81780 90.94888 84.81266
[15] 81.43135 91.29460 87.56686 81.83333 84.96745 87.01204
> colMin(tmp5)
[1] 58.55529 57.07438 54.88127 57.40673 56.70314 54.60911 60.13093 64.17277
[9] 54.70891 60.80958 62.69136 62.76540 61.66288 61.99511 64.02511 60.28161
[17] 61.82237 60.68765 59.28778 59.72940
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 90.55538 71.07396 70.25903 72.76019 71.84782 71.75692 73.38105 NA
[9] 70.59914 69.77682
> rowSums(tmp5)
[1] 1811.108 1421.479 1405.181 1455.204 1436.956 1435.138 1467.621 NA
[9] 1411.983 1395.536
> rowVars(tmp5)
[1] 8081.45041 67.77681 42.61359 69.83603 69.88472 117.72383
[7] 85.46480 125.23832 66.23329 87.43969
> rowSd(tmp5)
[1] 89.896888 8.232667 6.527908 8.356795 8.359708 10.850061 9.244718
[8] 11.190993 8.138384 9.350919
> rowMax(tmp5)
[1] 471.52484 81.54697 84.96745 88.51068 86.22953 93.96792 86.29377
[8] NA 90.94888 89.67082
> rowMin(tmp5)
[1] 54.88127 58.55529 60.81256 57.07438 58.27011 58.72737 54.60911 NA
[9] 57.40673 54.70891
>
> colMeans(tmp5)
[1] 110.36580 70.24559 NA 69.10362 66.48730 65.36635 72.26207
[8] 77.12443 70.78671 72.34465 71.47651 71.37868 74.29893 72.67678
[15] 72.45572 72.49514 77.19782 74.09808 69.61867 70.78129
> colSums(tmp5)
[1] 1103.6580 702.4559 NA 691.0362 664.8730 653.6635 722.6207
[8] 771.2443 707.8671 723.4465 714.7651 713.7868 742.9893 726.7678
[15] 724.5572 724.9514 771.9782 740.9808 696.1867 707.8129
> colVars(tmp5)
[1] 16228.70980 92.20822 NA 51.68944 53.07143 58.73294
[7] 127.44256 75.25759 74.50376 67.33275 29.44549 72.63194
[13] 93.34202 48.56056 37.01287 112.65395 52.64412 44.95250
[19] 70.92754 113.92090
> colSd(tmp5)
[1] 127.391953 9.602511 NA 7.189537 7.285014 7.663742
[7] 11.289046 8.675113 8.631556 8.205654 5.426370 8.522438
[13] 9.661367 6.968540 6.083820 10.613856 7.255627 6.704662
[19] 8.421849 10.673374
> colMax(tmp5)
[1] 471.52484 84.47354 NA 75.14231 76.05807 77.47249 92.58553
[8] 93.96792 86.29377 86.69050 77.66422 85.81780 90.94888 84.81266
[15] 81.43135 91.29460 87.56686 81.83333 84.96745 87.01204
> colMin(tmp5)
[1] 58.55529 57.07438 NA 57.40673 56.70314 54.60911 60.13093 64.17277
[9] 54.70891 60.80958 62.69136 62.76540 61.66288 61.99511 64.02511 60.28161
[17] 61.82237 60.68765 59.28778 59.72940
>
> Max(tmp5,na.rm=TRUE)
[1] 471.5248
> Min(tmp5,na.rm=TRUE)
[1] 54.60911
> mean(tmp5,na.rm=TRUE)
[1] 73.34764
> Sum(tmp5,na.rm=TRUE)
[1] 14596.18
> Var(tmp5,na.rm=TRUE)
[1] 879.4636
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.55538 71.07396 70.25903 72.76019 71.84782 71.75692 73.38105 71.36703
[9] 70.59914 69.77682
> rowSums(tmp5,na.rm=TRUE)
[1] 1811.108 1421.479 1405.181 1455.204 1436.956 1435.138 1467.621 1355.973
[9] 1411.983 1395.536
> rowVars(tmp5,na.rm=TRUE)
[1] 8081.45041 67.77681 42.61359 69.83603 69.88472 117.72383
[7] 85.46480 125.23832 66.23329 87.43969
> rowSd(tmp5,na.rm=TRUE)
[1] 89.896888 8.232667 6.527908 8.356795 8.359708 10.850061 9.244718
[8] 11.190993 8.138384 9.350919
> rowMax(tmp5,na.rm=TRUE)
[1] 471.52484 81.54697 84.96745 88.51068 86.22953 93.96792 86.29377
[8] 92.58553 90.94888 89.67082
> rowMin(tmp5,na.rm=TRUE)
[1] 54.88127 58.55529 60.81256 57.07438 58.27011 58.72737 54.60911 56.70314
[9] 57.40673 54.70891
>
> colMeans(tmp5,na.rm=TRUE)
[1] 110.36580 70.24559 65.61538 69.10362 66.48730 65.36635 72.26207
[8] 77.12443 70.78671 72.34465 71.47651 71.37868 74.29893 72.67678
[15] 72.45572 72.49514 77.19782 74.09808 69.61867 70.78129
> colSums(tmp5,na.rm=TRUE)
[1] 1103.6580 702.4559 590.5384 691.0362 664.8730 653.6635 722.6207
[8] 771.2443 707.8671 723.4465 714.7651 713.7868 742.9893 726.7678
[15] 724.5572 724.9514 771.9782 740.9808 696.1867 707.8129
> colVars(tmp5,na.rm=TRUE)
[1] 16228.70980 92.20822 33.93741 51.68944 53.07143 58.73294
[7] 127.44256 75.25759 74.50376 67.33275 29.44549 72.63194
[13] 93.34202 48.56056 37.01287 112.65395 52.64412 44.95250
[19] 70.92754 113.92090
> colSd(tmp5,na.rm=TRUE)
[1] 127.391953 9.602511 5.825582 7.189537 7.285014 7.663742
[7] 11.289046 8.675113 8.631556 8.205654 5.426370 8.522438
[13] 9.661367 6.968540 6.083820 10.613856 7.255627 6.704662
[19] 8.421849 10.673374
> colMax(tmp5,na.rm=TRUE)
[1] 471.52484 84.47354 74.32366 75.14231 76.05807 77.47249 92.58553
[8] 93.96792 86.29377 86.69050 77.66422 85.81780 90.94888 84.81266
[15] 81.43135 91.29460 87.56686 81.83333 84.96745 87.01204
> colMin(tmp5,na.rm=TRUE)
[1] 58.55529 57.07438 54.88127 57.40673 56.70314 54.60911 60.13093 64.17277
[9] 54.70891 60.80958 62.69136 62.76540 61.66288 61.99511 64.02511 60.28161
[17] 61.82237 60.68765 59.28778 59.72940
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.55538 71.07396 70.25903 72.76019 71.84782 71.75692 73.38105 NaN
[9] 70.59914 69.77682
> rowSums(tmp5,na.rm=TRUE)
[1] 1811.108 1421.479 1405.181 1455.204 1436.956 1435.138 1467.621 0.000
[9] 1411.983 1395.536
> rowVars(tmp5,na.rm=TRUE)
[1] 8081.45041 67.77681 42.61359 69.83603 69.88472 117.72383
[7] 85.46480 NA 66.23329 87.43969
> rowSd(tmp5,na.rm=TRUE)
[1] 89.896888 8.232667 6.527908 8.356795 8.359708 10.850061 9.244718
[8] NA 8.138384 9.350919
> rowMax(tmp5,na.rm=TRUE)
[1] 471.52484 81.54697 84.96745 88.51068 86.22953 93.96792 86.29377
[8] NA 90.94888 89.67082
> rowMin(tmp5,na.rm=TRUE)
[1] 54.88127 58.55529 60.81256 57.07438 58.27011 58.72737 54.60911 NA
[9] 57.40673 54.70891
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 115.95794 70.58474 NaN 68.64242 67.57443 66.21560 70.00391
[8] 75.80568 70.80675 72.93602 72.45264 71.98196 74.43040 72.07424
[15] 71.45843 73.82083 76.04571 74.78190 70.63347 69.31158
> colSums(tmp5,na.rm=TRUE)
[1] 1043.6215 635.2627 0.0000 617.7818 608.1699 595.9404 630.0352
[8] 682.2511 637.2607 656.4241 652.0738 647.8376 669.8736 648.6682
[15] 643.1258 664.3875 684.4114 673.0371 635.7012 623.8042
> colVars(tmp5,na.rm=TRUE)
[1] 17905.48734 102.44023 NA 55.75771 46.40955 57.96064
[7] 86.00581 65.09999 83.81221 71.81503 22.40688 77.61651
[13] 104.81533 50.54628 30.45031 106.96430 44.29171 45.31089
[19] 68.20803 103.86052
> colSd(tmp5,na.rm=TRUE)
[1] 133.811387 10.121276 NA 7.467108 6.812456 7.613189
[7] 9.273932 8.068456 9.154901 8.474375 4.733591 8.810023
[13] 10.237936 7.109591 5.518180 10.342355 6.655202 6.731337
[19] 8.258816 10.191198
> colMax(tmp5,na.rm=TRUE)
[1] 471.52484 84.47354 -Inf 75.14231 76.05807 77.47249 84.31457
[8] 93.96792 86.29377 86.69050 77.66422 85.81780 90.94888 84.81266
[15] 80.17653 91.29460 84.93492 81.83333 84.96745 87.01204
> colMin(tmp5,na.rm=TRUE)
[1] 58.55529 57.07438 Inf 57.40673 58.27011 54.60911 60.13093 64.17277
[9] 54.70891 60.80958 64.70012 62.76540 61.66288 61.99511 64.02511 60.28161
[17] 61.82237 60.68765 59.28778 59.72940
>
>
>
>
> 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] 129.8780 301.1703 417.4364 310.5427 270.7705 258.6032 211.2190 202.2047
[9] 329.0660 210.9445
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 129.8780 301.1703 417.4364 310.5427 270.7705 258.6032 211.2190 202.2047
[9] 329.0660 210.9445
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] 5.684342e-14 -5.684342e-14 0.000000e+00 -1.421085e-13 5.684342e-14
[6] -1.421085e-13 1.136868e-13 -5.684342e-14 -2.842171e-14 1.278977e-13
[11] 7.105427e-14 2.842171e-14 5.684342e-14 5.684342e-14 2.273737e-13
[16] -5.684342e-14 0.000000e+00 -1.421085e-14 -7.105427e-14 -1.136868e-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)
+ }
5 9
3 20
9 5
7 3
9 6
9 13
3 11
3 17
2 12
5 7
3 16
2 18
5 1
7 20
8 20
7 1
10 19
2 9
8 1
1 15
There were 50 or more warnings (use warnings() to see the first 50)
>
>
> ### now test 1 by n and n by 1 matrix
>
>
> err.tol <- 1e-12
>
> rm(tmp5)
>
> dataset1 <- rnorm(100)
> dataset2 <- rnorm(100)
>
> tmp <- createBufferedMatrix(1,100)
> tmp[1,] <- dataset1
>
> tmp2 <- createBufferedMatrix(100,1)
> tmp2[,1] <- dataset2
>
>
>
>
>
> Max(tmp)
[1] 2.96606
> Min(tmp)
[1] -2.121055
> mean(tmp)
[1] -0.02579451
> Sum(tmp)
[1] -2.579451
> Var(tmp)
[1] 1.05505
>
> rowMeans(tmp)
[1] -0.02579451
> rowSums(tmp)
[1] -2.579451
> rowVars(tmp)
[1] 1.05505
> rowSd(tmp)
[1] 1.027156
> rowMax(tmp)
[1] 2.96606
> rowMin(tmp)
[1] -2.121055
>
> colMeans(tmp)
[1] -1.551124043 0.637297549 0.880571013 0.895302050 -0.037395588
[6] 0.153985149 0.458411809 -0.569536998 -0.406670560 -1.359031520
[11] -1.598863591 0.032828116 -0.277898643 0.617230498 -0.388799092
[16] 0.047556870 -0.791573198 -0.926797220 0.644222588 0.334594480
[21] -1.846646144 -1.081976315 0.699825791 1.403001572 -0.128779282
[26] 0.687631346 0.467710719 1.403654301 0.682735929 -1.296697931
[31] 1.455446568 1.523142379 -0.556856483 -1.728464784 -1.078718877
[36] -0.369805718 -0.489442964 0.507317788 -2.121054757 -0.256074320
[41] 0.905038221 -1.657538586 -1.056878080 -1.790292624 0.579813322
[46] -0.087284733 0.917157964 0.037988979 -0.661087852 -0.021928686
[51] -0.129088116 -0.453979055 -0.214273790 -1.276750649 -0.912918976
[56] 0.404985221 -0.778743747 -0.156287936 -0.490047790 1.191000462
[61] 0.642506544 -0.937717060 0.621669831 -0.129755031 0.007293422
[66] -0.639002341 -0.344488786 -0.084094787 -1.208707567 1.533651371
[71] -0.759371272 0.422704298 -2.120903850 0.646158232 0.588327498
[76] 1.881809079 -0.263261234 -0.289837478 0.745437557 1.254860291
[81] 1.854072690 0.169385638 -1.096154240 -0.899897595 2.134315032
[86] -0.696353013 2.966060082 -0.024751026 -0.677740608 -0.716326159
[91] 0.772332577 -0.758270402 0.492009940 -1.090687502 0.884632326
[96] 2.801715279 1.391310255 -0.580102978 0.072560587 -0.163983035
> colSums(tmp)
[1] -1.551124043 0.637297549 0.880571013 0.895302050 -0.037395588
[6] 0.153985149 0.458411809 -0.569536998 -0.406670560 -1.359031520
[11] -1.598863591 0.032828116 -0.277898643 0.617230498 -0.388799092
[16] 0.047556870 -0.791573198 -0.926797220 0.644222588 0.334594480
[21] -1.846646144 -1.081976315 0.699825791 1.403001572 -0.128779282
[26] 0.687631346 0.467710719 1.403654301 0.682735929 -1.296697931
[31] 1.455446568 1.523142379 -0.556856483 -1.728464784 -1.078718877
[36] -0.369805718 -0.489442964 0.507317788 -2.121054757 -0.256074320
[41] 0.905038221 -1.657538586 -1.056878080 -1.790292624 0.579813322
[46] -0.087284733 0.917157964 0.037988979 -0.661087852 -0.021928686
[51] -0.129088116 -0.453979055 -0.214273790 -1.276750649 -0.912918976
[56] 0.404985221 -0.778743747 -0.156287936 -0.490047790 1.191000462
[61] 0.642506544 -0.937717060 0.621669831 -0.129755031 0.007293422
[66] -0.639002341 -0.344488786 -0.084094787 -1.208707567 1.533651371
[71] -0.759371272 0.422704298 -2.120903850 0.646158232 0.588327498
[76] 1.881809079 -0.263261234 -0.289837478 0.745437557 1.254860291
[81] 1.854072690 0.169385638 -1.096154240 -0.899897595 2.134315032
[86] -0.696353013 2.966060082 -0.024751026 -0.677740608 -0.716326159
[91] 0.772332577 -0.758270402 0.492009940 -1.090687502 0.884632326
[96] 2.801715279 1.391310255 -0.580102978 0.072560587 -0.163983035
> 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.551124043 0.637297549 0.880571013 0.895302050 -0.037395588
[6] 0.153985149 0.458411809 -0.569536998 -0.406670560 -1.359031520
[11] -1.598863591 0.032828116 -0.277898643 0.617230498 -0.388799092
[16] 0.047556870 -0.791573198 -0.926797220 0.644222588 0.334594480
[21] -1.846646144 -1.081976315 0.699825791 1.403001572 -0.128779282
[26] 0.687631346 0.467710719 1.403654301 0.682735929 -1.296697931
[31] 1.455446568 1.523142379 -0.556856483 -1.728464784 -1.078718877
[36] -0.369805718 -0.489442964 0.507317788 -2.121054757 -0.256074320
[41] 0.905038221 -1.657538586 -1.056878080 -1.790292624 0.579813322
[46] -0.087284733 0.917157964 0.037988979 -0.661087852 -0.021928686
[51] -0.129088116 -0.453979055 -0.214273790 -1.276750649 -0.912918976
[56] 0.404985221 -0.778743747 -0.156287936 -0.490047790 1.191000462
[61] 0.642506544 -0.937717060 0.621669831 -0.129755031 0.007293422
[66] -0.639002341 -0.344488786 -0.084094787 -1.208707567 1.533651371
[71] -0.759371272 0.422704298 -2.120903850 0.646158232 0.588327498
[76] 1.881809079 -0.263261234 -0.289837478 0.745437557 1.254860291
[81] 1.854072690 0.169385638 -1.096154240 -0.899897595 2.134315032
[86] -0.696353013 2.966060082 -0.024751026 -0.677740608 -0.716326159
[91] 0.772332577 -0.758270402 0.492009940 -1.090687502 0.884632326
[96] 2.801715279 1.391310255 -0.580102978 0.072560587 -0.163983035
> colMin(tmp)
[1] -1.551124043 0.637297549 0.880571013 0.895302050 -0.037395588
[6] 0.153985149 0.458411809 -0.569536998 -0.406670560 -1.359031520
[11] -1.598863591 0.032828116 -0.277898643 0.617230498 -0.388799092
[16] 0.047556870 -0.791573198 -0.926797220 0.644222588 0.334594480
[21] -1.846646144 -1.081976315 0.699825791 1.403001572 -0.128779282
[26] 0.687631346 0.467710719 1.403654301 0.682735929 -1.296697931
[31] 1.455446568 1.523142379 -0.556856483 -1.728464784 -1.078718877
[36] -0.369805718 -0.489442964 0.507317788 -2.121054757 -0.256074320
[41] 0.905038221 -1.657538586 -1.056878080 -1.790292624 0.579813322
[46] -0.087284733 0.917157964 0.037988979 -0.661087852 -0.021928686
[51] -0.129088116 -0.453979055 -0.214273790 -1.276750649 -0.912918976
[56] 0.404985221 -0.778743747 -0.156287936 -0.490047790 1.191000462
[61] 0.642506544 -0.937717060 0.621669831 -0.129755031 0.007293422
[66] -0.639002341 -0.344488786 -0.084094787 -1.208707567 1.533651371
[71] -0.759371272 0.422704298 -2.120903850 0.646158232 0.588327498
[76] 1.881809079 -0.263261234 -0.289837478 0.745437557 1.254860291
[81] 1.854072690 0.169385638 -1.096154240 -0.899897595 2.134315032
[86] -0.696353013 2.966060082 -0.024751026 -0.677740608 -0.716326159
[91] 0.772332577 -0.758270402 0.492009940 -1.090687502 0.884632326
[96] 2.801715279 1.391310255 -0.580102978 0.072560587 -0.163983035
> colMedians(tmp)
[1] -1.551124043 0.637297549 0.880571013 0.895302050 -0.037395588
[6] 0.153985149 0.458411809 -0.569536998 -0.406670560 -1.359031520
[11] -1.598863591 0.032828116 -0.277898643 0.617230498 -0.388799092
[16] 0.047556870 -0.791573198 -0.926797220 0.644222588 0.334594480
[21] -1.846646144 -1.081976315 0.699825791 1.403001572 -0.128779282
[26] 0.687631346 0.467710719 1.403654301 0.682735929 -1.296697931
[31] 1.455446568 1.523142379 -0.556856483 -1.728464784 -1.078718877
[36] -0.369805718 -0.489442964 0.507317788 -2.121054757 -0.256074320
[41] 0.905038221 -1.657538586 -1.056878080 -1.790292624 0.579813322
[46] -0.087284733 0.917157964 0.037988979 -0.661087852 -0.021928686
[51] -0.129088116 -0.453979055 -0.214273790 -1.276750649 -0.912918976
[56] 0.404985221 -0.778743747 -0.156287936 -0.490047790 1.191000462
[61] 0.642506544 -0.937717060 0.621669831 -0.129755031 0.007293422
[66] -0.639002341 -0.344488786 -0.084094787 -1.208707567 1.533651371
[71] -0.759371272 0.422704298 -2.120903850 0.646158232 0.588327498
[76] 1.881809079 -0.263261234 -0.289837478 0.745437557 1.254860291
[81] 1.854072690 0.169385638 -1.096154240 -0.899897595 2.134315032
[86] -0.696353013 2.966060082 -0.024751026 -0.677740608 -0.716326159
[91] 0.772332577 -0.758270402 0.492009940 -1.090687502 0.884632326
[96] 2.801715279 1.391310255 -0.580102978 0.072560587 -0.163983035
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -1.551124 0.6372975 0.880571 0.895302 -0.03739559 0.1539851 0.4584118
[2,] -1.551124 0.6372975 0.880571 0.895302 -0.03739559 0.1539851 0.4584118
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.569537 -0.4066706 -1.359032 -1.598864 0.03282812 -0.2778986 0.6172305
[2,] -0.569537 -0.4066706 -1.359032 -1.598864 0.03282812 -0.2778986 0.6172305
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.3887991 0.04755687 -0.7915732 -0.9267972 0.6442226 0.3345945 -1.846646
[2,] -0.3887991 0.04755687 -0.7915732 -0.9267972 0.6442226 0.3345945 -1.846646
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -1.081976 0.6998258 1.403002 -0.1287793 0.6876313 0.4677107 1.403654
[2,] -1.081976 0.6998258 1.403002 -0.1287793 0.6876313 0.4677107 1.403654
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.6827359 -1.296698 1.455447 1.523142 -0.5568565 -1.728465 -1.078719
[2,] 0.6827359 -1.296698 1.455447 1.523142 -0.5568565 -1.728465 -1.078719
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.3698057 -0.489443 0.5073178 -2.121055 -0.2560743 0.9050382 -1.657539
[2,] -0.3698057 -0.489443 0.5073178 -2.121055 -0.2560743 0.9050382 -1.657539
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -1.056878 -1.790293 0.5798133 -0.08728473 0.917158 0.03798898 -0.6610879
[2,] -1.056878 -1.790293 0.5798133 -0.08728473 0.917158 0.03798898 -0.6610879
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.02192869 -0.1290881 -0.4539791 -0.2142738 -1.276751 -0.912919 0.4049852
[2,] -0.02192869 -0.1290881 -0.4539791 -0.2142738 -1.276751 -0.912919 0.4049852
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.7787437 -0.1562879 -0.4900478 1.191 0.6425065 -0.9377171 0.6216698
[2,] -0.7787437 -0.1562879 -0.4900478 1.191 0.6425065 -0.9377171 0.6216698
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.129755 0.007293422 -0.6390023 -0.3444888 -0.08409479 -1.208708 1.533651
[2,] -0.129755 0.007293422 -0.6390023 -0.3444888 -0.08409479 -1.208708 1.533651
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.7593713 0.4227043 -2.120904 0.6461582 0.5883275 1.881809 -0.2632612
[2,] -0.7593713 0.4227043 -2.120904 0.6461582 0.5883275 1.881809 -0.2632612
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.2898375 0.7454376 1.25486 1.854073 0.1693856 -1.096154 -0.8998976
[2,] -0.2898375 0.7454376 1.25486 1.854073 0.1693856 -1.096154 -0.8998976
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 2.134315 -0.696353 2.96606 -0.02475103 -0.6777406 -0.7163262 0.7723326
[2,] 2.134315 -0.696353 2.96606 -0.02475103 -0.6777406 -0.7163262 0.7723326
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.7582704 0.4920099 -1.090688 0.8846323 2.801715 1.39131 -0.580103
[2,] -0.7582704 0.4920099 -1.090688 0.8846323 2.801715 1.39131 -0.580103
[,99] [,100]
[1,] 0.07256059 -0.163983
[2,] 0.07256059 -0.163983
>
>
> Max(tmp2)
[1] 2.450746
> Min(tmp2)
[1] -2.628847
> mean(tmp2)
[1] 0.0545066
> Sum(tmp2)
[1] 5.45066
> Var(tmp2)
[1] 0.9057385
>
> rowMeans(tmp2)
[1] -0.32924230 0.39789784 -0.40878514 0.39384897 0.29404357 0.39551824
[7] 0.81118744 0.09334257 1.11381244 0.48410679 1.03947359 0.10289926
[13] 0.72198966 0.45472330 -1.03242685 -1.70728709 1.49882914 -0.20948215
[19] -0.28812456 -0.58567652 1.74928484 -0.72311869 -1.36156459 -0.07018343
[25] 1.08403249 1.09492477 -0.94722279 -1.37607196 1.65380563 -0.23974770
[31] 0.25992394 1.59252019 0.99861385 0.64591780 -0.54128764 -0.56146753
[37] -0.35027071 -1.89547732 0.84378098 1.00683056 -1.14070976 -0.32573578
[43] -2.62884689 -0.98990234 -0.29308431 -2.03561391 -0.12151409 2.07893178
[49] 0.98589581 -0.92185410 -0.83868167 1.05069776 0.61950843 -0.88556421
[55] -0.77976885 -0.80138089 1.02087947 0.26901462 0.71376305 -0.52125521
[61] 0.24528538 -0.34020319 -0.73304887 0.52234095 1.98860655 -0.46223115
[67] -0.38310255 -0.58917096 -1.41473660 -0.99914460 1.03711739 -1.08116203
[73] -0.03237399 2.45074588 0.54232593 -0.54537250 -1.20602105 -0.91262381
[79] -0.37234788 -1.03152787 0.59287329 0.36196472 0.92076813 0.19426972
[85] 0.76276010 -0.12562950 0.38117487 0.18388284 0.65703555 -0.02517859
[91] 0.85507302 0.77208822 -1.20052388 0.19757689 0.79248995 0.23005188
[97] 0.63120555 0.69208605 1.10679709 0.22788969
> rowSums(tmp2)
[1] -0.32924230 0.39789784 -0.40878514 0.39384897 0.29404357 0.39551824
[7] 0.81118744 0.09334257 1.11381244 0.48410679 1.03947359 0.10289926
[13] 0.72198966 0.45472330 -1.03242685 -1.70728709 1.49882914 -0.20948215
[19] -0.28812456 -0.58567652 1.74928484 -0.72311869 -1.36156459 -0.07018343
[25] 1.08403249 1.09492477 -0.94722279 -1.37607196 1.65380563 -0.23974770
[31] 0.25992394 1.59252019 0.99861385 0.64591780 -0.54128764 -0.56146753
[37] -0.35027071 -1.89547732 0.84378098 1.00683056 -1.14070976 -0.32573578
[43] -2.62884689 -0.98990234 -0.29308431 -2.03561391 -0.12151409 2.07893178
[49] 0.98589581 -0.92185410 -0.83868167 1.05069776 0.61950843 -0.88556421
[55] -0.77976885 -0.80138089 1.02087947 0.26901462 0.71376305 -0.52125521
[61] 0.24528538 -0.34020319 -0.73304887 0.52234095 1.98860655 -0.46223115
[67] -0.38310255 -0.58917096 -1.41473660 -0.99914460 1.03711739 -1.08116203
[73] -0.03237399 2.45074588 0.54232593 -0.54537250 -1.20602105 -0.91262381
[79] -0.37234788 -1.03152787 0.59287329 0.36196472 0.92076813 0.19426972
[85] 0.76276010 -0.12562950 0.38117487 0.18388284 0.65703555 -0.02517859
[91] 0.85507302 0.77208822 -1.20052388 0.19757689 0.79248995 0.23005188
[97] 0.63120555 0.69208605 1.10679709 0.22788969
> 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.32924230 0.39789784 -0.40878514 0.39384897 0.29404357 0.39551824
[7] 0.81118744 0.09334257 1.11381244 0.48410679 1.03947359 0.10289926
[13] 0.72198966 0.45472330 -1.03242685 -1.70728709 1.49882914 -0.20948215
[19] -0.28812456 -0.58567652 1.74928484 -0.72311869 -1.36156459 -0.07018343
[25] 1.08403249 1.09492477 -0.94722279 -1.37607196 1.65380563 -0.23974770
[31] 0.25992394 1.59252019 0.99861385 0.64591780 -0.54128764 -0.56146753
[37] -0.35027071 -1.89547732 0.84378098 1.00683056 -1.14070976 -0.32573578
[43] -2.62884689 -0.98990234 -0.29308431 -2.03561391 -0.12151409 2.07893178
[49] 0.98589581 -0.92185410 -0.83868167 1.05069776 0.61950843 -0.88556421
[55] -0.77976885 -0.80138089 1.02087947 0.26901462 0.71376305 -0.52125521
[61] 0.24528538 -0.34020319 -0.73304887 0.52234095 1.98860655 -0.46223115
[67] -0.38310255 -0.58917096 -1.41473660 -0.99914460 1.03711739 -1.08116203
[73] -0.03237399 2.45074588 0.54232593 -0.54537250 -1.20602105 -0.91262381
[79] -0.37234788 -1.03152787 0.59287329 0.36196472 0.92076813 0.19426972
[85] 0.76276010 -0.12562950 0.38117487 0.18388284 0.65703555 -0.02517859
[91] 0.85507302 0.77208822 -1.20052388 0.19757689 0.79248995 0.23005188
[97] 0.63120555 0.69208605 1.10679709 0.22788969
> rowMin(tmp2)
[1] -0.32924230 0.39789784 -0.40878514 0.39384897 0.29404357 0.39551824
[7] 0.81118744 0.09334257 1.11381244 0.48410679 1.03947359 0.10289926
[13] 0.72198966 0.45472330 -1.03242685 -1.70728709 1.49882914 -0.20948215
[19] -0.28812456 -0.58567652 1.74928484 -0.72311869 -1.36156459 -0.07018343
[25] 1.08403249 1.09492477 -0.94722279 -1.37607196 1.65380563 -0.23974770
[31] 0.25992394 1.59252019 0.99861385 0.64591780 -0.54128764 -0.56146753
[37] -0.35027071 -1.89547732 0.84378098 1.00683056 -1.14070976 -0.32573578
[43] -2.62884689 -0.98990234 -0.29308431 -2.03561391 -0.12151409 2.07893178
[49] 0.98589581 -0.92185410 -0.83868167 1.05069776 0.61950843 -0.88556421
[55] -0.77976885 -0.80138089 1.02087947 0.26901462 0.71376305 -0.52125521
[61] 0.24528538 -0.34020319 -0.73304887 0.52234095 1.98860655 -0.46223115
[67] -0.38310255 -0.58917096 -1.41473660 -0.99914460 1.03711739 -1.08116203
[73] -0.03237399 2.45074588 0.54232593 -0.54537250 -1.20602105 -0.91262381
[79] -0.37234788 -1.03152787 0.59287329 0.36196472 0.92076813 0.19426972
[85] 0.76276010 -0.12562950 0.38117487 0.18388284 0.65703555 -0.02517859
[91] 0.85507302 0.77208822 -1.20052388 0.19757689 0.79248995 0.23005188
[97] 0.63120555 0.69208605 1.10679709 0.22788969
>
> colMeans(tmp2)
[1] 0.0545066
> colSums(tmp2)
[1] 5.45066
> colVars(tmp2)
[1] 0.9057385
> colSd(tmp2)
[1] 0.951703
> colMax(tmp2)
[1] 2.450746
> colMin(tmp2)
[1] -2.628847
> colMedians(tmp2)
[1] 0.1890763
> colRanges(tmp2)
[,1]
[1,] -2.628847
[2,] 2.450746
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] -2.8844406 -0.8456947 -1.9021585 0.3056317 5.6549446 6.3167619
[7] -3.9820697 1.1866646 -1.4572010 -3.8540039
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.0839559
[2,] -0.6536147
[3,] -0.2710993
[4,] 0.1087620
[5,] 0.5298807
>
> rowApply(tmp,sum)
[1] 1.7952093 4.0063936 2.2722304 -0.7470687 -1.1591492 -5.9234615
[7] 1.3663016 2.2937656 -0.5612980 -4.8044889
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 8 2 6 5 7 5 2 5 7 5
[2,] 6 5 2 2 8 7 1 4 6 9
[3,] 2 1 1 7 4 10 6 10 2 8
[4,] 3 7 5 6 2 2 4 2 9 10
[5,] 5 8 9 10 10 8 10 3 8 3
[6,] 10 4 8 4 9 9 8 9 10 4
[7,] 4 10 7 1 1 6 5 1 3 7
[8,] 9 9 4 8 5 4 7 8 5 2
[9,] 1 6 10 9 6 1 3 7 4 6
[10,] 7 3 3 3 3 3 9 6 1 1
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 1.2973624 -3.1173820 -3.0978362 0.2217606 -2.5351614 1.7937448
[7] -2.3752753 -0.2743914 -0.1124285 3.0166169 -1.1845555 0.8495029
[13] 0.9613520 3.0487436 -0.8152697 3.0946203 1.5247409 -0.5431286
[19] 5.1180826 -1.8840278
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.7417061
[2,] -0.1840886
[3,] 0.2578756
[4,] 0.8335476
[5,] 1.1317339
>
> rowApply(tmp,sum)
[1] -6.239929 1.512648 3.372475 2.332474 4.009403
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 19 6 8 13 16
[2,] 13 3 12 1 2
[3,] 2 11 16 3 1
[4,] 11 10 14 8 4
[5,] 6 9 7 4 5
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1.1317339 0.008509863 -1.5142964 -0.31569238 -1.1285381 -1.1443125
[2,] -0.7417061 -0.875110300 0.0574558 0.02352582 -0.4071929 0.4993727
[3,] -0.1840886 0.538956037 0.8953875 0.72198990 -0.2768628 0.3813488
[4,] 0.2578756 -1.253196678 -0.8601230 -0.01070279 -0.6021839 0.3907332
[5,] 0.8335476 -1.536540940 -1.6762601 -0.19735992 -0.1203837 1.6666025
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.80250439 -2.23281786 -0.61916928 0.5247146 -1.499928792 -0.584555278
[2,] 0.42842919 0.14428780 0.64059202 -0.4147229 -1.511530025 2.875491401
[3,] -0.86042553 0.86677688 -1.16803524 1.1214370 0.063150893 -0.835985542
[4,] -1.12269186 0.98731604 1.10780049 1.2723156 0.008033361 0.009101601
[5,] -0.01808275 -0.03995422 -0.07361653 0.5128726 1.755719093 -0.614549330
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.82202863 0.05225469 -1.21255917 -0.001085376 0.86576381 0.71770112
[2,] -0.51280732 -0.79649446 0.21621889 0.978099955 1.80478386 -0.86095350
[3,] 1.19378567 2.30988046 0.19886753 0.673451232 -0.79310838 -0.35895291
[4,] -0.55176537 1.33054581 -0.08888584 0.216954129 -0.37100629 0.07743812
[5,] 0.01011043 0.15255706 0.07108892 1.227200312 0.01830792 -0.11836145
[,19] [,20]
[1,] 1.2617569 -0.5689334
[2,] 0.9328520 -0.9679435
[3,] 0.9223296 -2.0374278
[4,] 0.4691928 1.0657227
[5,] 1.5319513 0.6245541
>
>
> 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 : 653 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.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 col8
row1 0.90836 0.4805287 1.089468 -0.8206705 0.6603712 1.446223 1.197822 1.318494
col9 col10 col11 col12 col13 col14 col15
row1 -2.518097 0.4357921 -0.06333467 1.50443 -1.259658 0.6767999 0.2447883
col16 col17 col18 col19 col20
row1 0.3644374 -0.4537222 -0.03128267 0.5675473 0.4997151
> tmp[,"col10"]
col10
row1 0.4357921
row2 0.2046155
row3 -0.8656146
row4 -0.4282036
row5 -1.1100428
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 0.9083600 0.4805287 1.0894678 -0.8206705 0.6603712 1.446223 1.197822
row5 -0.9874487 1.3160399 0.8757428 -0.5743583 0.5092327 -1.035162 -1.069730
col8 col9 col10 col11 col12 col13 col14
row1 1.318494 -2.518097 0.4357921 -0.06333467 1.50443 -1.2596577 0.6767999
row5 1.550262 -1.753412 -1.1100428 1.37638833 -1.52709 0.3968359 0.6384286
col15 col16 col17 col18 col19 col20
row1 0.2447883 0.3644374 -0.4537222 -0.03128267 0.5675473 0.4997151
row5 0.4768224 -0.2501678 -0.5736002 1.18489432 -0.3293209 -0.7084536
> tmp[,c("col6","col20")]
col6 col20
row1 1.4462225 0.4997151
row2 -0.5606914 0.3210362
row3 2.1654190 0.7571573
row4 -1.1601477 0.1364549
row5 -1.0351618 -0.7084536
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 1.446223 0.4997151
row5 -1.035162 -0.7084536
>
>
>
>
> 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 50.28017 51.29278 48.51716 49.22237 50.59052 104.4738 50.5349 50.28139
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.54978 49.89566 48.66884 48.54787 50.87467 48.51434 50.28223 50.32392
col17 col18 col19 col20
row1 48.9197 50.78756 50.22191 104.7159
> tmp[,"col10"]
col10
row1 49.89566
row2 31.53486
row3 31.36165
row4 28.62766
row5 50.64159
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.28017 51.29278 48.51716 49.22237 50.59052 104.4738 50.53490 50.28139
row5 51.78168 51.91721 50.18033 51.25153 50.92810 105.9139 50.04544 49.35548
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.54978 49.89566 48.66884 48.54787 50.87467 48.51434 50.28223 50.32392
row5 50.09747 50.64159 49.50065 48.65422 49.51784 48.64660 49.73112 51.00735
col17 col18 col19 col20
row1 48.91970 50.78756 50.22191 104.7159
row5 50.17497 50.31772 47.35017 104.9664
> tmp[,c("col6","col20")]
col6 col20
row1 104.47382 104.71587
row2 74.79614 75.11114
row3 74.62916 75.67456
row4 74.01331 74.59725
row5 105.91392 104.96640
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.4738 104.7159
row5 105.9139 104.9664
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.4738 104.7159
row5 105.9139 104.9664
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.96692874
[2,] -2.05274717
[3,] -0.31227273
[4,] 0.08548368
[5,] 0.02636244
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.01690773 -1.577290928
[2,] -1.56740856 -2.685894177
[3,] -1.05661897 -0.910365901
[4,] -1.08848257 0.005121809
[5,] 0.04477250 -0.022710111
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.4757365 0.1991025
[2,] -1.2315448 -0.2836971
[3,] 2.4746108 -1.2047180
[4,] 1.0012745 2.0418271
[5,] 0.6764726 -0.1285209
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.4757365
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.4757365
[2,] -1.2315448
>
>
>
> 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 -1.14103 0.3827107 0.6940379 0.3878748 0.2357125 -0.5224310 1.2080747
row1 1.16348 0.9102284 -0.4773520 0.1672859 -0.3532162 -0.2058492 -0.3903538
[,8] [,9] [,10] [,11] [,12] [,13]
row3 0.2628714 0.4761302 -0.3215964 -1.4246659 -0.6560889 -0.9149310
row1 0.1179462 -0.1580876 -1.3758603 0.5758106 1.3363725 -0.2251616
[,14] [,15] [,16] [,17] [,18] [,19]
row3 -0.6465203 1.22057412 -1.523256 0.21982601 -1.4605292 -0.9580394
row1 0.3602489 0.08840676 1.894028 -0.06249962 0.1198706 1.2722010
[,20]
row3 -1.5672453
row1 -0.5172935
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.6788246 0.04458659 -1.156583 0.5749598 0.3222655 -1.118326 -0.1513879
[,8] [,9] [,10]
row2 0.671385 2.057508 0.7212063
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -1.045515 -1.273272 0.9969807 0.384857 -0.4811007 -0.3060732 -0.5574921
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.04550327 -0.8553921 0.02697145 1.493742 -0.02766775 -1.201781 0.8264795
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.05542502 -0.6436723 1.166426 -0.6765382 -1.350725 0.4949518
>
>
> 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: 0x5e9243afef40>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c8c54e8bdba0"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c8c546f689886"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c8c5479d5e9aa"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c8c5418de162e"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c8c54be4686b"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c8c54712c505"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c8c543bd0e315"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c8c545c1a609b"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c8c5435fa2225"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c8c5425d28909"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c8c543c354d84"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c8c545b219745"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c8c5459f1e709"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c8c545da7643d"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM2c8c545d126563"
>
>
> ### 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: 0x5e92454b89f0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5e92454b89f0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5e92454b89f0>
> rowMedians(tmp)
[1] 0.1831185436 0.0454277437 0.0021669834 0.2077279406 -0.4031600922
[6] 0.0455401186 -0.4086680373 -0.0383408646 -0.1586607078 -0.2479828602
[11] -0.0133202835 0.0403251309 0.1213625691 -0.3829221093 -0.4457549459
[16] -0.3198144914 -0.2362623201 0.2415221519 -0.5056416078 0.1719925952
[21] 0.1625436096 -0.2096736489 -0.2360956884 -0.1504563547 0.0652953123
[26] 0.0725854425 0.6851868964 -0.1593001786 -0.2990971241 0.3335025119
[31] -0.4007116951 0.2120359437 0.5985681277 -0.2710451040 0.0202241506
[36] -0.3148114798 -0.0335953932 0.1098791655 0.4968652680 0.5081350734
[41] 0.0208266445 0.1262880704 -0.5191502884 -0.4188351570 -0.6085739188
[46] -0.1783356718 0.4396456257 -0.2877156164 0.0224060283 -0.1804267514
[51] -0.6558156599 -0.1472104335 0.1916078788 0.1389987340 0.5256356546
[56] -0.1346672137 -0.0849139840 -0.0691577929 0.4049689200 0.2733550196
[61] 0.3801969700 0.0202032761 -0.4630284942 0.7537054727 -0.2797416447
[66] 0.3998324260 -0.0975210373 0.2010170386 -0.2073985456 0.0794148093
[71] 0.0590302430 -0.5609461519 0.6347876165 -0.1219682614 -0.1682025099
[76] -0.0794414193 -0.1213870893 0.2538466387 0.0778761939 -0.0717448965
[81] 0.0462335123 -0.1234063430 -0.1258106715 -0.1685312124 0.3380852234
[86] -0.1915809527 0.1826149129 -0.1193256776 0.2159056696 0.1726655909
[91] 0.0216286261 -0.2233531520 -0.0432773747 0.1892693683 -0.2011615981
[96] -0.2920751998 0.1667133345 0.1895490660 1.0880754438 -0.0439645985
[101] -0.0589009513 0.1358763790 0.2995994234 0.3475157211 -0.6530506683
[106] 0.5169912021 -0.0409667409 0.0188169589 -0.3581701046 -0.5418276953
[111] 0.3753359102 -0.0116167734 0.0428070293 0.3380346021 -0.4802596133
[116] 0.0357778441 -0.2418390840 -0.2727554099 -0.2892895865 0.3651671265
[121] -0.1663831212 0.4304453091 -0.2253811888 -0.5594327185 0.0633990276
[126] 0.6083956312 -0.2234767337 0.1710624078 -0.3638422390 -0.3632956476
[131] 0.0718536286 0.1521122009 -0.3495761919 0.2779537275 0.2846853354
[136] -0.1651981499 0.2324913367 0.2971006273 0.4065635458 -0.7365577066
[141] -0.7844818549 0.1046224712 0.0108807055 -0.1376205444 0.2330045515
[146] -0.4402454202 0.1842107340 0.0412915739 -0.1077774482 -0.0495569054
[151] 0.0319937651 -1.1414736042 -0.2568596785 -0.3085380081 0.1558107608
[156] 0.1660776229 -0.0675401390 -0.0588494600 -0.2557938502 -0.4982280471
[161] -1.0234645865 0.1981652072 0.4131590333 -0.4379706977 -0.0236858951
[166] -0.3615049607 0.0154330862 -0.1224907658 -0.2675283136 0.2306741468
[171] -0.3727262571 0.5192572306 0.2051121432 0.3381539658 0.2833335295
[176] 0.2769726886 0.0166839955 -0.0233414283 -0.2536868990 -0.1342115590
[181] 0.4248343865 0.2690405454 0.1860095603 -0.0648137190 0.0650996202
[186] 0.0002876606 0.2536195558 0.1768785715 0.3296054775 -0.2216725700
[191] 0.1388403116 0.6349862656 -0.1802877745 0.1325716773 0.3690206378
[196] -0.1712672577 -0.1156962108 0.0346275344 0.1741498665 0.1797105911
[201] 0.0473302583 -0.4345896352 0.2918318239 -0.1630164904 0.3126441213
[206] 0.7325021618 -0.2138797100 0.3579429768 0.1467905959 0.0550450607
[211] 0.0057044592 -0.3366266050 -0.7664887084 -0.2342449618 -0.6020540007
[216] 0.0547007385 0.2757100173 0.1251127205 -0.1517631014 0.0099934587
[221] -0.0579528285 -0.0683719887 -0.0251659354 0.2697150299 -0.0225690503
[226] -0.0973303358 0.2376979029 0.3941270850 -0.2750303091 0.1840326457
>
> proc.time()
user system elapsed
1.297 1.467 2.753
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2026-03-05 r89546) -- "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: 0x6339577fcff0>
> .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: 0x6339577fcff0>
> .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: 0x6339577fcff0>
> .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: 0x6339577fcff0>
> 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: 0x6339574a8710>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6339574a8710>
> .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: 0x6339574a8710>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6339574a8710>
> .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: 0x6339574a8710>
> 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: 0x63395780c3f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x63395780c3f0>
> .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: 0x63395780c3f0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x63395780c3f0>
> .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: 0x63395780c3f0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x63395780c3f0>
> .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: 0x63395780c3f0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x63395780c3f0>
> .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: 0x63395780c3f0>
> 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: 0x633956f438c0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x633956f438c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x633956f438c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x633956f438c0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2c8d5f4c9880b3" "BufferedMatrixFile2c8d5f5ea49803"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2c8d5f4c9880b3" "BufferedMatrixFile2c8d5f5ea49803"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x633956c6fe30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x633956c6fe30>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x633956c6fe30>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x633956c6fe30>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x633956c6fe30>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x633956c6fe30>
> .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: 0x633957dcb790>
> .Call("R_bm_AddColumn",P)
<pointer: 0x633957dcb790>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x633957dcb790>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x633957dcb790>
> 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: 0x6339571b6860>
> .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: 0x6339571b6860>
> rm(P)
>
> proc.time()
user system elapsed
0.227 0.066 0.282
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2026-03-05 r89546) -- "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.240 0.050 0.275