| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-03-26 11:34 -0400 (Thu, 26 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" | 4876 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2026-03-20 r89666) -- "Unsuffered Consequences" | 4574 |
| 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 258/2372 | 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 | OK | OK | WARNINGS | ERROR | |||||||||
| 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-25 21:45:48 -0400 (Wed, 25 Mar 2026) |
| EndedAt: 2026-03-25 21:46:13 -0400 (Wed, 25 Mar 2026) |
| EllapsedTime: 25.1 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-26 01:45:48 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.239 0.057 0.285
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 25 21:46:03 2026"
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,] == test.matrix[which.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
> date()
[1] "Wed Mar 25 21:46:03 2026"
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:10,5,replace=TRUE)
+ if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
>
>
>
>
>
> RowMode(tmp2)
<pointer: 0x5a6735cc14f0>
>
>
>
> 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 25 21:46:04 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 25 21:46:04 2026"
>
> ColMode(tmp2)
<pointer: 0x5a6735cc14f0>
>
>
>
> ### 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,] 99.753949 -0.7322693 -0.007100633 1.0788979
[2,] 1.055345 -1.1605085 -0.311296753 -0.3132852
[3,] 1.316227 -1.6576591 1.182763602 1.6934131
[4,] -1.002032 -1.3720257 -0.108984668 0.6831870
> 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 : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 99.753949 0.7322693 0.007100633 1.0788979
[2,] 1.055345 1.1605085 0.311296753 0.3132852
[3,] 1.316227 1.6576591 1.182763602 1.6934131
[4,] 1.002032 1.3720257 0.108984668 0.6831870
> 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 : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 9.987690 0.8557273 0.08426525 1.0387001
[2,] 1.027300 1.0772690 0.55793974 0.5597189
[3,] 1.147269 1.2875011 1.08754936 1.3013121
[4,] 1.001016 1.1713350 0.33012826 0.8265513
>
> 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 : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 224.63085 34.28954 25.84975 36.46590
[2,] 36.32834 36.93320 30.89069 30.91047
[3,] 37.78892 39.53267 37.05826 39.70653
[4,] 36.01219 38.08538 28.41027 33.94870
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x5a673731f5a0>
> exp(tmp5)
<pointer: 0x5a673731f5a0>
> log(tmp5,2)
<pointer: 0x5a673731f5a0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.5397
> Min(tmp5)
[1] 53.80287
> mean(tmp5)
[1] 73.84093
> Sum(tmp5)
[1] 14768.19
> Var(tmp5)
[1] 856.0897
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.49613 69.72482 77.55847 71.90487 70.91118 74.76929 69.86429 73.53210
[9] 70.50599 69.14219
> rowSums(tmp5)
[1] 1809.923 1394.496 1551.169 1438.097 1418.224 1495.386 1397.286 1470.642
[9] 1410.120 1382.844
> rowVars(tmp5)
[1] 7947.74710 85.99334 29.92949 71.42024 89.11853 72.09111
[7] 74.63169 67.68625 57.47676 80.36069
> rowSd(tmp5)
[1] 89.150138 9.273260 5.470785 8.451049 9.440261 8.490648 8.638964
[8] 8.227165 7.581343 8.964412
> rowMax(tmp5)
[1] 467.53968 85.72396 89.03658 90.91835 85.14222 88.34205 84.72505
[8] 88.08918 89.82619 90.33723
> rowMin(tmp5)
[1] 53.80287 54.50831 67.60301 58.97092 57.97086 57.62131 57.11891 56.22909
[9] 60.53193 56.45186
>
> colMeans(tmp5)
[1] 112.33702 71.67562 67.61549 73.19736 68.88438 75.43780 69.58823
[8] 72.74135 73.14047 70.78488 72.09760 71.76377 73.66906 71.99696
[15] 73.78745 72.05392 67.85715 70.41335 74.04214 73.73466
> colSums(tmp5)
[1] 1123.3702 716.7562 676.1549 731.9736 688.8438 754.3780 695.8823
[8] 727.4135 731.4047 707.8488 720.9760 717.6377 736.6906 719.9696
[15] 737.8745 720.5392 678.5715 704.1335 740.4214 737.3466
> colVars(tmp5)
[1] 15607.78034 79.44389 124.43772 53.42782 132.11301 103.75417
[7] 60.76657 82.19016 21.40023 53.98652 127.84570 72.53756
[13] 47.76194 64.66372 57.77591 64.21224 67.77487 113.18399
[19] 117.22735 50.55071
> colSd(tmp5)
[1] 124.931102 8.913130 11.155166 7.309434 11.494043 10.185979
[7] 7.795292 9.065879 4.626039 7.347552 11.306887 8.516898
[13] 6.911001 8.041376 7.601047 8.013254 8.232550 10.638796
[19] 10.827158 7.109903
> colMax(tmp5)
[1] 467.53968 82.28207 87.43908 82.64395 89.82619 90.91835 83.42216
[8] 88.34205 80.76272 86.13257 88.08918 83.18795 81.62941 82.47525
[15] 85.14222 84.06258 85.30216 89.03658 90.33723 88.04917
> colMin(tmp5)
[1] 66.73080 57.62131 53.80287 61.80728 56.99781 57.97086 55.08504 59.41103
[9] 65.59366 59.01743 58.14202 58.43552 62.31833 54.50831 62.82969 60.53193
[17] 60.15928 56.45186 58.50395 67.39149
>
>
> ### 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.49613 69.72482 77.55847 71.90487 NA 74.76929 69.86429 73.53210
[9] 70.50599 69.14219
> rowSums(tmp5)
[1] 1809.923 1394.496 1551.169 1438.097 NA 1495.386 1397.286 1470.642
[9] 1410.120 1382.844
> rowVars(tmp5)
[1] 7947.74710 85.99334 29.92949 71.42024 88.72733 72.09111
[7] 74.63169 67.68625 57.47676 80.36069
> rowSd(tmp5)
[1] 89.150138 9.273260 5.470785 8.451049 9.419518 8.490648 8.638964
[8] 8.227165 7.581343 8.964412
> rowMax(tmp5)
[1] 467.53968 85.72396 89.03658 90.91835 NA 88.34205 84.72505
[8] 88.08918 89.82619 90.33723
> rowMin(tmp5)
[1] 53.80287 54.50831 67.60301 58.97092 NA 57.62131 57.11891 56.22909
[9] 60.53193 56.45186
>
> colMeans(tmp5)
[1] 112.33702 71.67562 NA 73.19736 68.88438 75.43780 69.58823
[8] 72.74135 73.14047 70.78488 72.09760 71.76377 73.66906 71.99696
[15] 73.78745 72.05392 67.85715 70.41335 74.04214 73.73466
> colSums(tmp5)
[1] 1123.3702 716.7562 NA 731.9736 688.8438 754.3780 695.8823
[8] 727.4135 731.4047 707.8488 720.9760 717.6377 736.6906 719.9696
[15] 737.8745 720.5392 678.5715 704.1335 740.4214 737.3466
> colVars(tmp5)
[1] 15607.78034 79.44389 NA 53.42782 132.11301 103.75417
[7] 60.76657 82.19016 21.40023 53.98652 127.84570 72.53756
[13] 47.76194 64.66372 57.77591 64.21224 67.77487 113.18399
[19] 117.22735 50.55071
> colSd(tmp5)
[1] 124.931102 8.913130 NA 7.309434 11.494043 10.185979
[7] 7.795292 9.065879 4.626039 7.347552 11.306887 8.516898
[13] 6.911001 8.041376 7.601047 8.013254 8.232550 10.638796
[19] 10.827158 7.109903
> colMax(tmp5)
[1] 467.53968 82.28207 NA 82.64395 89.82619 90.91835 83.42216
[8] 88.34205 80.76272 86.13257 88.08918 83.18795 81.62941 82.47525
[15] 85.14222 84.06258 85.30216 89.03658 90.33723 88.04917
> colMin(tmp5)
[1] 66.73080 57.62131 NA 61.80728 56.99781 57.97086 55.08504 59.41103
[9] 65.59366 59.01743 58.14202 58.43552 62.31833 54.50831 62.82969 60.53193
[17] 60.15928 56.45186 58.50395 67.39149
>
> Max(tmp5,na.rm=TRUE)
[1] 467.5397
> Min(tmp5,na.rm=TRUE)
[1] 53.80287
> mean(tmp5,na.rm=TRUE)
[1] 73.80763
> Sum(tmp5,na.rm=TRUE)
[1] 14687.72
> Var(tmp5,na.rm=TRUE)
[1] 860.1904
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.49613 69.72482 77.55847 71.90487 70.40814 74.76929 69.86429 73.53210
[9] 70.50599 69.14219
> rowSums(tmp5,na.rm=TRUE)
[1] 1809.923 1394.496 1551.169 1438.097 1337.755 1495.386 1397.286 1470.642
[9] 1410.120 1382.844
> rowVars(tmp5,na.rm=TRUE)
[1] 7947.74710 85.99334 29.92949 71.42024 88.72733 72.09111
[7] 74.63169 67.68625 57.47676 80.36069
> rowSd(tmp5,na.rm=TRUE)
[1] 89.150138 9.273260 5.470785 8.451049 9.419518 8.490648 8.638964
[8] 8.227165 7.581343 8.964412
> rowMax(tmp5,na.rm=TRUE)
[1] 467.53968 85.72396 89.03658 90.91835 85.14222 88.34205 84.72505
[8] 88.08918 89.82619 90.33723
> rowMin(tmp5,na.rm=TRUE)
[1] 53.80287 54.50831 67.60301 58.97092 57.97086 57.62131 57.11891 56.22909
[9] 60.53193 56.45186
>
> colMeans(tmp5,na.rm=TRUE)
[1] 112.33702 71.67562 66.18732 73.19736 68.88438 75.43780 69.58823
[8] 72.74135 73.14047 70.78488 72.09760 71.76377 73.66906 71.99696
[15] 73.78745 72.05392 67.85715 70.41335 74.04214 73.73466
> colSums(tmp5,na.rm=TRUE)
[1] 1123.3702 716.7562 595.6858 731.9736 688.8438 754.3780 695.8823
[8] 727.4135 731.4047 707.8488 720.9760 717.6377 736.6906 719.9696
[15] 737.8745 720.5392 678.5715 704.1335 740.4214 737.3466
> colVars(tmp5,na.rm=TRUE)
[1] 15607.78034 79.44389 117.04614 53.42782 132.11301 103.75417
[7] 60.76657 82.19016 21.40023 53.98652 127.84570 72.53756
[13] 47.76194 64.66372 57.77591 64.21224 67.77487 113.18399
[19] 117.22735 50.55071
> colSd(tmp5,na.rm=TRUE)
[1] 124.931102 8.913130 10.818787 7.309434 11.494043 10.185979
[7] 7.795292 9.065879 4.626039 7.347552 11.306887 8.516898
[13] 6.911001 8.041376 7.601047 8.013254 8.232550 10.638796
[19] 10.827158 7.109903
> colMax(tmp5,na.rm=TRUE)
[1] 467.53968 82.28207 87.43908 82.64395 89.82619 90.91835 83.42216
[8] 88.34205 80.76272 86.13257 88.08918 83.18795 81.62941 82.47525
[15] 85.14222 84.06258 85.30216 89.03658 90.33723 88.04917
> colMin(tmp5,na.rm=TRUE)
[1] 66.73080 57.62131 53.80287 61.80728 56.99781 57.97086 55.08504 59.41103
[9] 65.59366 59.01743 58.14202 58.43552 62.31833 54.50831 62.82969 60.53193
[17] 60.15928 56.45186 58.50395 67.39149
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.49613 69.72482 77.55847 71.90487 NaN 74.76929 69.86429 73.53210
[9] 70.50599 69.14219
> rowSums(tmp5,na.rm=TRUE)
[1] 1809.923 1394.496 1551.169 1438.097 0.000 1495.386 1397.286 1470.642
[9] 1410.120 1382.844
> rowVars(tmp5,na.rm=TRUE)
[1] 7947.74710 85.99334 29.92949 71.42024 NA 72.09111
[7] 74.63169 67.68625 57.47676 80.36069
> rowSd(tmp5,na.rm=TRUE)
[1] 89.150138 9.273260 5.470785 8.451049 NA 8.490648 8.638964
[8] 8.227165 7.581343 8.964412
> rowMax(tmp5,na.rm=TRUE)
[1] 467.53968 85.72396 89.03658 90.91835 NA 88.34205 84.72505
[8] 88.08918 89.82619 90.33723
> rowMin(tmp5,na.rm=TRUE)
[1] 53.80287 54.50831 67.60301 58.97092 NA 57.62131 57.11891 56.22909
[9] 60.53193 56.45186
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 115.49122 72.79711 NaN 73.65596 69.93898 77.37857 70.20084
[8] 74.22249 72.62701 71.26992 72.70999 70.49442 74.93025 72.64296
[15] 72.52581 71.36671 66.79327 70.90066 72.82415 74.37158
> colSums(tmp5,na.rm=TRUE)
[1] 1039.4210 655.1740 0.0000 662.9037 629.4508 696.4071 631.8076
[8] 668.0025 653.6431 641.4293 654.3899 634.4497 674.3723 653.7866
[15] 652.7323 642.3004 601.1395 638.1059 655.4173 669.3442
> colVars(tmp5,na.rm=TRUE)
[1] 17446.82672 75.22498 NA 57.74027 136.11505 74.34927
[7] 64.14039 67.78373 21.10930 58.08812 139.60748 63.47809
[13] 35.83785 68.05186 47.09087 66.92582 63.51358 124.66050
[19] 115.19140 52.30579
> colSd(tmp5,na.rm=TRUE)
[1] 132.086437 8.673234 NA 7.598702 11.666835 8.622602
[7] 8.008769 8.233088 4.594486 7.621556 11.815561 7.967314
[13] 5.986472 8.249355 6.862279 8.180820 7.969541 11.165147
[19] 10.732726 7.232274
> colMax(tmp5,na.rm=TRUE)
[1] 467.53968 82.28207 -Inf 82.64395 89.82619 90.91835 83.42216
[8] 88.34205 80.76272 86.13257 88.08918 80.47353 81.62941 82.47525
[15] 83.07878 84.06258 85.30216 89.03658 90.33723 88.04917
> colMin(tmp5,na.rm=TRUE)
[1] 66.73080 57.62131 Inf 61.80728 56.99781 61.81385 55.08504 61.57514
[9] 65.59366 59.01743 58.14202 58.43552 62.96077 54.50831 62.82969 60.53193
[17] 60.15928 56.45186 58.50395 67.39149
>
>
>
>
> 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] 121.3493 242.9178 156.8013 230.0699 192.1006 203.4750 252.3618 261.5902
[9] 270.9379 197.6818
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 121.3493 242.9178 156.8013 230.0699 192.1006 203.4750 252.3618 261.5902
[9] 270.9379 197.6818
>
>
>
> 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] -9.947598e-14 -5.684342e-14 -5.684342e-14 2.273737e-13 -1.136868e-13
[6] 2.842171e-14 -4.263256e-14 1.136868e-13 -1.421085e-14 -1.705303e-13
[11] 0.000000e+00 -5.684342e-14 -5.684342e-14 0.000000e+00 1.421085e-13
[16] 8.526513e-14 -1.136868e-13 5.684342e-14 0.000000e+00 -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 8
2 2
7 13
1 10
9 2
10 7
7 9
1 9
6 6
8 12
6 14
3 10
5 9
6 7
4 18
4 2
5 8
1 14
10 4
1 9
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.224246
> Min(tmp)
[1] -2.095183
> mean(tmp)
[1] 0.02829026
> Sum(tmp)
[1] 2.829026
> Var(tmp)
[1] 0.9498261
>
> rowMeans(tmp)
[1] 0.02829026
> rowSums(tmp)
[1] 2.829026
> rowVars(tmp)
[1] 0.9498261
> rowSd(tmp)
[1] 0.9745902
> rowMax(tmp)
[1] 2.224246
> rowMin(tmp)
[1] -2.095183
>
> colMeans(tmp)
[1] 0.8633060456 -0.6842992154 -0.9063664704 1.1888646178 -1.1462728020
[6] -1.1984793016 0.7093721403 0.8602341864 -0.2196605583 -0.2674182897
[11] -1.7222664928 1.0374532187 0.6187096365 -0.3323111521 -1.4754539888
[16] 0.7134669744 0.2637057551 1.3337520198 0.5271145692 -0.4892104583
[21] 0.4354677117 2.2242460006 0.3505179719 2.2177765706 -1.3380161883
[26] 1.8686260055 -0.2153552163 0.5720731983 -1.5461442149 0.0886411409
[31] -0.4928993267 -0.8062269537 -0.2669268912 1.6343130533 -0.0004809225
[36] -2.0512500806 -0.0764659178 -0.4228163932 -0.4919381625 -0.2690030923
[41] -0.1096962518 0.0886989862 -0.3274210205 0.1741913075 -1.2476686084
[46] 0.3773929839 -0.0831953345 -2.0951826721 -1.0895899712 -1.2481960481
[51] 0.6595085116 0.8066731506 -0.4034162645 -0.4028218895 0.7604565367
[56] 0.4443638723 0.5587313600 0.3150726492 -0.6092017437 0.8083603594
[61] 1.9607845131 0.4685448500 0.5316269157 -0.3020932848 -1.7408680602
[66] 1.0471393057 0.8271927888 0.3336917796 -0.4901842043 0.1504518272
[71] 0.4023563711 2.0156357610 -0.2527015719 0.9750221196 0.9584884750
[76] -1.2104597156 1.0935862993 0.4528945537 -0.0770112596 -0.6383569639
[81] 1.2175474074 0.1838998844 1.7715461281 -1.2080251595 0.2761408688
[86] 0.4998649800 -0.0734351898 -1.4587675612 -0.8478490951 -1.1866598501
[91] 0.4403251957 1.3297738616 0.7298514073 -1.6741173667 -0.3806005040
[96] 0.3327508396 0.4616185236 -0.8968579140 -0.6566057381 -1.0025539833
> colSums(tmp)
[1] 0.8633060456 -0.6842992154 -0.9063664704 1.1888646178 -1.1462728020
[6] -1.1984793016 0.7093721403 0.8602341864 -0.2196605583 -0.2674182897
[11] -1.7222664928 1.0374532187 0.6187096365 -0.3323111521 -1.4754539888
[16] 0.7134669744 0.2637057551 1.3337520198 0.5271145692 -0.4892104583
[21] 0.4354677117 2.2242460006 0.3505179719 2.2177765706 -1.3380161883
[26] 1.8686260055 -0.2153552163 0.5720731983 -1.5461442149 0.0886411409
[31] -0.4928993267 -0.8062269537 -0.2669268912 1.6343130533 -0.0004809225
[36] -2.0512500806 -0.0764659178 -0.4228163932 -0.4919381625 -0.2690030923
[41] -0.1096962518 0.0886989862 -0.3274210205 0.1741913075 -1.2476686084
[46] 0.3773929839 -0.0831953345 -2.0951826721 -1.0895899712 -1.2481960481
[51] 0.6595085116 0.8066731506 -0.4034162645 -0.4028218895 0.7604565367
[56] 0.4443638723 0.5587313600 0.3150726492 -0.6092017437 0.8083603594
[61] 1.9607845131 0.4685448500 0.5316269157 -0.3020932848 -1.7408680602
[66] 1.0471393057 0.8271927888 0.3336917796 -0.4901842043 0.1504518272
[71] 0.4023563711 2.0156357610 -0.2527015719 0.9750221196 0.9584884750
[76] -1.2104597156 1.0935862993 0.4528945537 -0.0770112596 -0.6383569639
[81] 1.2175474074 0.1838998844 1.7715461281 -1.2080251595 0.2761408688
[86] 0.4998649800 -0.0734351898 -1.4587675612 -0.8478490951 -1.1866598501
[91] 0.4403251957 1.3297738616 0.7298514073 -1.6741173667 -0.3806005040
[96] 0.3327508396 0.4616185236 -0.8968579140 -0.6566057381 -1.0025539833
> 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.8633060456 -0.6842992154 -0.9063664704 1.1888646178 -1.1462728020
[6] -1.1984793016 0.7093721403 0.8602341864 -0.2196605583 -0.2674182897
[11] -1.7222664928 1.0374532187 0.6187096365 -0.3323111521 -1.4754539888
[16] 0.7134669744 0.2637057551 1.3337520198 0.5271145692 -0.4892104583
[21] 0.4354677117 2.2242460006 0.3505179719 2.2177765706 -1.3380161883
[26] 1.8686260055 -0.2153552163 0.5720731983 -1.5461442149 0.0886411409
[31] -0.4928993267 -0.8062269537 -0.2669268912 1.6343130533 -0.0004809225
[36] -2.0512500806 -0.0764659178 -0.4228163932 -0.4919381625 -0.2690030923
[41] -0.1096962518 0.0886989862 -0.3274210205 0.1741913075 -1.2476686084
[46] 0.3773929839 -0.0831953345 -2.0951826721 -1.0895899712 -1.2481960481
[51] 0.6595085116 0.8066731506 -0.4034162645 -0.4028218895 0.7604565367
[56] 0.4443638723 0.5587313600 0.3150726492 -0.6092017437 0.8083603594
[61] 1.9607845131 0.4685448500 0.5316269157 -0.3020932848 -1.7408680602
[66] 1.0471393057 0.8271927888 0.3336917796 -0.4901842043 0.1504518272
[71] 0.4023563711 2.0156357610 -0.2527015719 0.9750221196 0.9584884750
[76] -1.2104597156 1.0935862993 0.4528945537 -0.0770112596 -0.6383569639
[81] 1.2175474074 0.1838998844 1.7715461281 -1.2080251595 0.2761408688
[86] 0.4998649800 -0.0734351898 -1.4587675612 -0.8478490951 -1.1866598501
[91] 0.4403251957 1.3297738616 0.7298514073 -1.6741173667 -0.3806005040
[96] 0.3327508396 0.4616185236 -0.8968579140 -0.6566057381 -1.0025539833
> colMin(tmp)
[1] 0.8633060456 -0.6842992154 -0.9063664704 1.1888646178 -1.1462728020
[6] -1.1984793016 0.7093721403 0.8602341864 -0.2196605583 -0.2674182897
[11] -1.7222664928 1.0374532187 0.6187096365 -0.3323111521 -1.4754539888
[16] 0.7134669744 0.2637057551 1.3337520198 0.5271145692 -0.4892104583
[21] 0.4354677117 2.2242460006 0.3505179719 2.2177765706 -1.3380161883
[26] 1.8686260055 -0.2153552163 0.5720731983 -1.5461442149 0.0886411409
[31] -0.4928993267 -0.8062269537 -0.2669268912 1.6343130533 -0.0004809225
[36] -2.0512500806 -0.0764659178 -0.4228163932 -0.4919381625 -0.2690030923
[41] -0.1096962518 0.0886989862 -0.3274210205 0.1741913075 -1.2476686084
[46] 0.3773929839 -0.0831953345 -2.0951826721 -1.0895899712 -1.2481960481
[51] 0.6595085116 0.8066731506 -0.4034162645 -0.4028218895 0.7604565367
[56] 0.4443638723 0.5587313600 0.3150726492 -0.6092017437 0.8083603594
[61] 1.9607845131 0.4685448500 0.5316269157 -0.3020932848 -1.7408680602
[66] 1.0471393057 0.8271927888 0.3336917796 -0.4901842043 0.1504518272
[71] 0.4023563711 2.0156357610 -0.2527015719 0.9750221196 0.9584884750
[76] -1.2104597156 1.0935862993 0.4528945537 -0.0770112596 -0.6383569639
[81] 1.2175474074 0.1838998844 1.7715461281 -1.2080251595 0.2761408688
[86] 0.4998649800 -0.0734351898 -1.4587675612 -0.8478490951 -1.1866598501
[91] 0.4403251957 1.3297738616 0.7298514073 -1.6741173667 -0.3806005040
[96] 0.3327508396 0.4616185236 -0.8968579140 -0.6566057381 -1.0025539833
> colMedians(tmp)
[1] 0.8633060456 -0.6842992154 -0.9063664704 1.1888646178 -1.1462728020
[6] -1.1984793016 0.7093721403 0.8602341864 -0.2196605583 -0.2674182897
[11] -1.7222664928 1.0374532187 0.6187096365 -0.3323111521 -1.4754539888
[16] 0.7134669744 0.2637057551 1.3337520198 0.5271145692 -0.4892104583
[21] 0.4354677117 2.2242460006 0.3505179719 2.2177765706 -1.3380161883
[26] 1.8686260055 -0.2153552163 0.5720731983 -1.5461442149 0.0886411409
[31] -0.4928993267 -0.8062269537 -0.2669268912 1.6343130533 -0.0004809225
[36] -2.0512500806 -0.0764659178 -0.4228163932 -0.4919381625 -0.2690030923
[41] -0.1096962518 0.0886989862 -0.3274210205 0.1741913075 -1.2476686084
[46] 0.3773929839 -0.0831953345 -2.0951826721 -1.0895899712 -1.2481960481
[51] 0.6595085116 0.8066731506 -0.4034162645 -0.4028218895 0.7604565367
[56] 0.4443638723 0.5587313600 0.3150726492 -0.6092017437 0.8083603594
[61] 1.9607845131 0.4685448500 0.5316269157 -0.3020932848 -1.7408680602
[66] 1.0471393057 0.8271927888 0.3336917796 -0.4901842043 0.1504518272
[71] 0.4023563711 2.0156357610 -0.2527015719 0.9750221196 0.9584884750
[76] -1.2104597156 1.0935862993 0.4528945537 -0.0770112596 -0.6383569639
[81] 1.2175474074 0.1838998844 1.7715461281 -1.2080251595 0.2761408688
[86] 0.4998649800 -0.0734351898 -1.4587675612 -0.8478490951 -1.1866598501
[91] 0.4403251957 1.3297738616 0.7298514073 -1.6741173667 -0.3806005040
[96] 0.3327508396 0.4616185236 -0.8968579140 -0.6566057381 -1.0025539833
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.863306 -0.6842992 -0.9063665 1.188865 -1.146273 -1.198479 0.7093721
[2,] 0.863306 -0.6842992 -0.9063665 1.188865 -1.146273 -1.198479 0.7093721
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.8602342 -0.2196606 -0.2674183 -1.722266 1.037453 0.6187096 -0.3323112
[2,] 0.8602342 -0.2196606 -0.2674183 -1.722266 1.037453 0.6187096 -0.3323112
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -1.475454 0.713467 0.2637058 1.333752 0.5271146 -0.4892105 0.4354677
[2,] -1.475454 0.713467 0.2637058 1.333752 0.5271146 -0.4892105 0.4354677
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 2.224246 0.350518 2.217777 -1.338016 1.868626 -0.2153552 0.5720732
[2,] 2.224246 0.350518 2.217777 -1.338016 1.868626 -0.2153552 0.5720732
[,29] [,30] [,31] [,32] [,33] [,34]
[1,] -1.546144 0.08864114 -0.4928993 -0.806227 -0.2669269 1.634313
[2,] -1.546144 0.08864114 -0.4928993 -0.806227 -0.2669269 1.634313
[,35] [,36] [,37] [,38] [,39] [,40]
[1,] -0.0004809225 -2.05125 -0.07646592 -0.4228164 -0.4919382 -0.2690031
[2,] -0.0004809225 -2.05125 -0.07646592 -0.4228164 -0.4919382 -0.2690031
[,41] [,42] [,43] [,44] [,45] [,46] [,47]
[1,] -0.1096963 0.08869899 -0.327421 0.1741913 -1.247669 0.377393 -0.08319533
[2,] -0.1096963 0.08869899 -0.327421 0.1741913 -1.247669 0.377393 -0.08319533
[,48] [,49] [,50] [,51] [,52] [,53] [,54]
[1,] -2.095183 -1.08959 -1.248196 0.6595085 0.8066732 -0.4034163 -0.4028219
[2,] -2.095183 -1.08959 -1.248196 0.6595085 0.8066732 -0.4034163 -0.4028219
[,55] [,56] [,57] [,58] [,59] [,60] [,61]
[1,] 0.7604565 0.4443639 0.5587314 0.3150726 -0.6092017 0.8083604 1.960785
[2,] 0.7604565 0.4443639 0.5587314 0.3150726 -0.6092017 0.8083604 1.960785
[,62] [,63] [,64] [,65] [,66] [,67] [,68]
[1,] 0.4685449 0.5316269 -0.3020933 -1.740868 1.047139 0.8271928 0.3336918
[2,] 0.4685449 0.5316269 -0.3020933 -1.740868 1.047139 0.8271928 0.3336918
[,69] [,70] [,71] [,72] [,73] [,74] [,75]
[1,] -0.4901842 0.1504518 0.4023564 2.015636 -0.2527016 0.9750221 0.9584885
[2,] -0.4901842 0.1504518 0.4023564 2.015636 -0.2527016 0.9750221 0.9584885
[,76] [,77] [,78] [,79] [,80] [,81] [,82]
[1,] -1.21046 1.093586 0.4528946 -0.07701126 -0.638357 1.217547 0.1838999
[2,] -1.21046 1.093586 0.4528946 -0.07701126 -0.638357 1.217547 0.1838999
[,83] [,84] [,85] [,86] [,87] [,88] [,89]
[1,] 1.771546 -1.208025 0.2761409 0.499865 -0.07343519 -1.458768 -0.8478491
[2,] 1.771546 -1.208025 0.2761409 0.499865 -0.07343519 -1.458768 -0.8478491
[,90] [,91] [,92] [,93] [,94] [,95] [,96]
[1,] -1.18666 0.4403252 1.329774 0.7298514 -1.674117 -0.3806005 0.3327508
[2,] -1.18666 0.4403252 1.329774 0.7298514 -1.674117 -0.3806005 0.3327508
[,97] [,98] [,99] [,100]
[1,] 0.4616185 -0.8968579 -0.6566057 -1.002554
[2,] 0.4616185 -0.8968579 -0.6566057 -1.002554
>
>
> Max(tmp2)
[1] 2.338408
> Min(tmp2)
[1] -2.807844
> mean(tmp2)
[1] 0.06266699
> Sum(tmp2)
[1] 6.266699
> Var(tmp2)
[1] 1.038861
>
> rowMeans(tmp2)
[1] -1.24763726 0.50435918 -0.36773793 -2.22527096 1.31650180 2.27363289
[7] 1.00872736 1.39594084 -2.80784381 0.11743703 0.27814608 -0.22701945
[13] -1.22080218 0.61423324 -0.65622555 0.84912912 1.02406090 1.91235132
[19] 0.59259463 -1.44790743 -0.20116790 -0.02960685 1.46112380 -0.02640059
[25] -0.35989028 -0.55043682 -0.53327626 -0.18401122 -0.43784400 -0.89578986
[31] 1.02951520 -0.52387267 -0.16159338 -2.24252507 -0.83121173 2.19472268
[37] -0.15931823 -0.69728686 0.23432974 1.83357612 -0.83226153 -0.75870362
[43] 0.02068416 1.57083966 0.50310321 -0.05038823 -0.08656591 1.25498378
[49] 0.58478661 0.77457032 -1.04973447 -1.28528242 0.88231315 2.33840805
[55] 0.02989877 -0.15961128 -0.04505708 0.55717041 0.09804542 -0.93255240
[61] 0.50330754 1.21029194 1.34862707 -0.38798761 -0.22415335 0.72270189
[67] -0.58568052 0.04517593 0.03813057 -0.87042009 0.96390539 -1.41395134
[73] 1.22093555 0.59357055 -1.29906666 0.99659259 1.10816629 0.33176187
[79] 0.32087883 -1.75937242 -0.09029733 -1.20518504 0.60362320 -0.37801515
[85] 0.16063583 0.57503607 -1.73780344 0.42988719 -0.90785918 0.60129578
[91] 1.28604996 0.16042038 -1.12199516 -0.28064020 -0.16117466 -0.97436707
[97] -0.37375151 0.30076639 1.68704639 0.80926010
> rowSums(tmp2)
[1] -1.24763726 0.50435918 -0.36773793 -2.22527096 1.31650180 2.27363289
[7] 1.00872736 1.39594084 -2.80784381 0.11743703 0.27814608 -0.22701945
[13] -1.22080218 0.61423324 -0.65622555 0.84912912 1.02406090 1.91235132
[19] 0.59259463 -1.44790743 -0.20116790 -0.02960685 1.46112380 -0.02640059
[25] -0.35989028 -0.55043682 -0.53327626 -0.18401122 -0.43784400 -0.89578986
[31] 1.02951520 -0.52387267 -0.16159338 -2.24252507 -0.83121173 2.19472268
[37] -0.15931823 -0.69728686 0.23432974 1.83357612 -0.83226153 -0.75870362
[43] 0.02068416 1.57083966 0.50310321 -0.05038823 -0.08656591 1.25498378
[49] 0.58478661 0.77457032 -1.04973447 -1.28528242 0.88231315 2.33840805
[55] 0.02989877 -0.15961128 -0.04505708 0.55717041 0.09804542 -0.93255240
[61] 0.50330754 1.21029194 1.34862707 -0.38798761 -0.22415335 0.72270189
[67] -0.58568052 0.04517593 0.03813057 -0.87042009 0.96390539 -1.41395134
[73] 1.22093555 0.59357055 -1.29906666 0.99659259 1.10816629 0.33176187
[79] 0.32087883 -1.75937242 -0.09029733 -1.20518504 0.60362320 -0.37801515
[85] 0.16063583 0.57503607 -1.73780344 0.42988719 -0.90785918 0.60129578
[91] 1.28604996 0.16042038 -1.12199516 -0.28064020 -0.16117466 -0.97436707
[97] -0.37375151 0.30076639 1.68704639 0.80926010
> 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.24763726 0.50435918 -0.36773793 -2.22527096 1.31650180 2.27363289
[7] 1.00872736 1.39594084 -2.80784381 0.11743703 0.27814608 -0.22701945
[13] -1.22080218 0.61423324 -0.65622555 0.84912912 1.02406090 1.91235132
[19] 0.59259463 -1.44790743 -0.20116790 -0.02960685 1.46112380 -0.02640059
[25] -0.35989028 -0.55043682 -0.53327626 -0.18401122 -0.43784400 -0.89578986
[31] 1.02951520 -0.52387267 -0.16159338 -2.24252507 -0.83121173 2.19472268
[37] -0.15931823 -0.69728686 0.23432974 1.83357612 -0.83226153 -0.75870362
[43] 0.02068416 1.57083966 0.50310321 -0.05038823 -0.08656591 1.25498378
[49] 0.58478661 0.77457032 -1.04973447 -1.28528242 0.88231315 2.33840805
[55] 0.02989877 -0.15961128 -0.04505708 0.55717041 0.09804542 -0.93255240
[61] 0.50330754 1.21029194 1.34862707 -0.38798761 -0.22415335 0.72270189
[67] -0.58568052 0.04517593 0.03813057 -0.87042009 0.96390539 -1.41395134
[73] 1.22093555 0.59357055 -1.29906666 0.99659259 1.10816629 0.33176187
[79] 0.32087883 -1.75937242 -0.09029733 -1.20518504 0.60362320 -0.37801515
[85] 0.16063583 0.57503607 -1.73780344 0.42988719 -0.90785918 0.60129578
[91] 1.28604996 0.16042038 -1.12199516 -0.28064020 -0.16117466 -0.97436707
[97] -0.37375151 0.30076639 1.68704639 0.80926010
> rowMin(tmp2)
[1] -1.24763726 0.50435918 -0.36773793 -2.22527096 1.31650180 2.27363289
[7] 1.00872736 1.39594084 -2.80784381 0.11743703 0.27814608 -0.22701945
[13] -1.22080218 0.61423324 -0.65622555 0.84912912 1.02406090 1.91235132
[19] 0.59259463 -1.44790743 -0.20116790 -0.02960685 1.46112380 -0.02640059
[25] -0.35989028 -0.55043682 -0.53327626 -0.18401122 -0.43784400 -0.89578986
[31] 1.02951520 -0.52387267 -0.16159338 -2.24252507 -0.83121173 2.19472268
[37] -0.15931823 -0.69728686 0.23432974 1.83357612 -0.83226153 -0.75870362
[43] 0.02068416 1.57083966 0.50310321 -0.05038823 -0.08656591 1.25498378
[49] 0.58478661 0.77457032 -1.04973447 -1.28528242 0.88231315 2.33840805
[55] 0.02989877 -0.15961128 -0.04505708 0.55717041 0.09804542 -0.93255240
[61] 0.50330754 1.21029194 1.34862707 -0.38798761 -0.22415335 0.72270189
[67] -0.58568052 0.04517593 0.03813057 -0.87042009 0.96390539 -1.41395134
[73] 1.22093555 0.59357055 -1.29906666 0.99659259 1.10816629 0.33176187
[79] 0.32087883 -1.75937242 -0.09029733 -1.20518504 0.60362320 -0.37801515
[85] 0.16063583 0.57503607 -1.73780344 0.42988719 -0.90785918 0.60129578
[91] 1.28604996 0.16042038 -1.12199516 -0.28064020 -0.16117466 -0.97436707
[97] -0.37375151 0.30076639 1.68704639 0.80926010
>
> colMeans(tmp2)
[1] 0.06266699
> colSums(tmp2)
[1] 6.266699
> colVars(tmp2)
[1] 1.038861
> colSd(tmp2)
[1] 1.019246
> colMax(tmp2)
[1] 2.338408
> colMin(tmp2)
[1] -2.807844
> colMedians(tmp2)
[1] 0.02529147
> colRanges(tmp2)
[,1]
[1,] -2.807844
[2,] 2.338408
>
> 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.8327515 1.7190555 0.2617407 -2.6111139 -4.0635510 0.5795645
[7] -0.8622291 -5.3385945 -1.9383752 -4.9512554
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.4808140
[2,] -1.1132500
[3,] -0.4790550
[4,] 0.3143249
[5,] 1.9011229
>
> rowApply(tmp,sum)
[1] -5.7552298 0.3259970 -4.2869836 -1.8979456 -1.4457087 -2.9807117
[7] -5.3514951 2.0761557 -1.2107811 0.4891928
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 9 8 3 5 1 6 1 2 1 10
[2,] 4 10 10 8 9 4 7 8 7 3
[3,] 7 5 6 9 4 3 6 9 6 6
[4,] 10 3 8 4 8 2 5 1 8 8
[5,] 2 7 5 2 5 1 8 3 4 7
[6,] 8 4 4 10 3 7 2 10 10 1
[7,] 6 9 1 6 2 9 9 5 3 9
[8,] 1 2 9 1 6 8 10 6 2 4
[9,] 3 6 7 7 10 5 3 7 5 2
[10,] 5 1 2 3 7 10 4 4 9 5
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.8221064 -3.0610417 -0.7637812 0.4536379 -1.1314816 -1.8253727
[7] -1.8825671 1.9357746 2.6773794 3.9763515 -1.7642635 0.2905140
[13] -1.3283528 -1.1501363 1.3979589 -3.6477502 0.7023805 0.6159567
[19] 1.5714792 0.1442938
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.7768044
[2,] 0.1561202
[3,] 0.3119901
[4,] 0.3716243
[5,] 0.7591762
>
> rowApply(tmp,sum)
[1] 2.6511022 1.7480974 -0.4832856 -2.5534780 -3.3293501
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 15 10 16 10 5
[2,] 13 9 2 2 8
[3,] 7 12 8 8 7
[4,] 9 13 4 20 13
[5,] 10 1 15 3 19
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.3716243 0.28309929 -0.06429743 -0.009442684 0.0759950 -0.5474426
[2,] 0.3119901 -0.09527967 0.41550435 0.453905464 -1.5535600 0.6261382
[3,] 0.7591762 -1.54422092 -0.30660219 -1.108977371 0.4120301 0.8820579
[4,] 0.1561202 -1.37856537 -0.33020559 1.059402170 -1.3546683 -0.8628152
[5,] -0.7768044 -0.32607498 -0.47818033 0.058750367 1.2887217 -1.9233110
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.16884267 1.1175757 -0.1123881 0.7410180 0.7965571 0.3332827
[2,] -1.38453893 -1.1114507 -0.5239019 1.3636376 -0.9472359 1.3827809
[3,] -0.02048848 0.1010880 2.3439885 1.0104498 -1.6458387 -0.5918421
[4,] -0.66575405 1.0165307 0.8536356 0.5393934 0.2534946 0.2794327
[5,] 0.01937167 0.8120309 0.1160452 0.3218527 -0.2212405 -1.1131402
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.43377156 -0.1970791 -0.7100805 -0.01801658 -0.2185791 0.51368403
[2,] -0.09831942 1.7436749 0.3819503 -1.51203785 0.8396282 -0.32837906
[3,] -1.17162423 -0.5946976 0.3135433 0.40726105 0.9081541 0.29515074
[4,] -0.69606832 -1.9552517 0.9775571 -1.34373862 0.4356500 0.17544924
[5,] 0.20388759 -0.1467828 0.4349887 -1.18121822 -1.2624727 -0.03994826
[,19] [,20]
[1,] 0.19620409 -0.5032262
[2,] 0.63341585 1.1501751
[3,] -0.76566009 -0.1662336
[4,] 0.01244729 0.2744762
[5,] 1.49507207 -0.6108977
>
>
> 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 : 649 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 : 562 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.911709 -0.6389128 0.3226585 -0.1090809 1.568227 -0.6323413 1.247234
col8 col9 col10 col11 col12 col13 col14
row1 -1.412292 0.2663424 1.937751 -0.6196694 0.7846153 -2.092106 -2.051095
col15 col16 col17 col18 col19 col20
row1 -0.4979771 1.20676 1.813343 -0.198819 0.428925 1.482827
> tmp[,"col10"]
col10
row1 1.9377505
row2 0.8453684
row3 2.7821282
row4 -0.0108720
row5 -0.2387867
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 1.911709 -0.6389128 0.32265853 -0.1090809 1.568227 -0.6323413 1.247234
row5 1.449735 0.4621261 0.09912224 0.1123978 -0.591369 -0.2350128 -1.282153
col8 col9 col10 col11 col12 col13 col14
row1 -1.4122916 0.2663424 1.9377505 -0.61966939 0.7846153 -2.092106 -2.051095
row5 -0.5852053 -0.1579868 -0.2387867 0.03857093 0.6770418 -1.270311 0.510754
col15 col16 col17 col18 col19 col20
row1 -0.4979771 1.206760 1.81334283 -0.1988190 0.428925 1.4828266
row5 -1.1769858 1.195531 -0.04394718 -0.6348842 -1.548595 0.1323439
> tmp[,c("col6","col20")]
col6 col20
row1 -0.6323413 1.4828266
row2 -0.2126977 -1.2625512
row3 -0.3827647 -0.1209541
row4 -0.2684737 -1.2420104
row5 -0.2350128 0.1323439
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.6323413 1.4828266
row5 -0.2350128 0.1323439
>
>
>
>
> tmp["row1",] <- rnorm(20,mean=10)
> tmp[,"col10"] <- rnorm(5,mean=30)
> tmp[c("row1","row5"),] <- rnorm(40,mean=50)
> tmp[,c("col6","col20")] <- rnorm(10,mean=75)
> tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105)
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.7784 49.17924 50.54418 48.89387 48.89547 105.152 49.5612 50.32145
col9 col10 col11 col12 col13 col14 col15 col16
row1 52.06135 50.56685 51.16582 49.21161 50.66187 50.31932 49.61787 50.13849
col17 col18 col19 col20
row1 48.57153 50.40852 50.75941 105.4728
> tmp[,"col10"]
col10
row1 50.56685
row2 30.63173
row3 30.30969
row4 29.69788
row5 50.92848
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.77840 49.17924 50.54418 48.89387 48.89547 105.1520 49.56120 50.32145
row5 51.63735 49.23389 49.21177 49.94996 49.92412 105.2377 50.39364 50.18575
col9 col10 col11 col12 col13 col14 col15 col16
row1 52.06135 50.56685 51.16582 49.21161 50.66187 50.31932 49.61787 50.13849
row5 49.15697 50.92848 51.96037 50.13629 48.63385 48.81420 48.46101 49.68849
col17 col18 col19 col20
row1 48.57153 50.40852 50.75941 105.4728
row5 50.43565 50.56650 49.18111 106.6388
> tmp[,c("col6","col20")]
col6 col20
row1 105.15196 105.47279
row2 75.64407 75.15054
row3 74.86591 74.99113
row4 75.11312 74.68341
row5 105.23772 106.63882
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.1520 105.4728
row5 105.2377 106.6388
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.1520 105.4728
row5 105.2377 106.6388
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.01297536
[2,] -1.09780468
[3,] -0.98310581
[4,] -0.15063122
[5,] -1.16006781
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.15906271 0.9300535
[2,] -0.52933083 -1.2942041
[3,] -1.14745684 0.9755206
[4,] 0.02729217 -1.0796496
[5,] -0.50976614 1.6159548
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.7113232 -0.6085952
[2,] 0.8575333 0.1893003
[3,] -1.5417773 -1.9638044
[4,] 0.5993826 -0.6915438
[5,] -0.9957953 -0.8552181
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.7113232
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.7113232
[2,] 0.8575333
>
>
>
> 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.667096 -1.8950396 0.305437 0.1513086 -1.34567487 1.6789059 -1.1239677
row1 -1.308044 0.4072978 1.142296 -1.0399216 0.04376343 0.3740041 0.8984563
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 0.4734431 -1.4149734 -0.6364913 0.977521 0.8498221 1.378314 -1.587523
row1 -0.3232001 -0.2046868 0.6280269 -1.511111 2.0692614 1.779987 1.326599
[,15] [,16] [,17] [,18] [,19] [,20]
row3 1.7648850 -0.7179483 -0.7290705 2.185109 -0.3443941 -0.8192376
row1 -0.1132394 -0.3574090 0.8333796 -1.301972 0.5282923 0.6249979
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.1594982 1.39165 0.3299267 -0.04506899 -0.7664471 0.006976898 0.7467794
[,8] [,9] [,10]
row2 -1.013765 -0.5800138 -0.7936984
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 1.230859 -1.357393 -0.3622054 2.055924 -0.4872744 1.035701 1.285528
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.300993 -0.207697 1.560726 -0.4278366 -1.796892 1.861608 -1.121298
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.1560176 1.219027 -0.4272673 -0.5840307 -0.3584509 -0.1372807
>
>
> 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: 0x5a6735ad0930>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM721cc7d868339"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM721cc70e0a501"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM721cc266e7f02"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM721cc26917839"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM721cc4361ec87"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM721cc5f3ee5d"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM721cc3b0c6de0"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM721cc3eeee910"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM721cc1ed67c7"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM721cc280cff2b"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM721cc1660ae8d"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM721cc6f67b989"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM721cc1ea2f3a4"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM721cc14d497c9"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM721cc55de7ad9"
>
>
> ### 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: 0x5a6737b69df0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x5a6737b69df0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x5a6737b69df0>
> rowMedians(tmp)
[1] 0.2889575814 -0.0792633637 -0.4099482691 -0.1816330875 0.2947471191
[6] 0.3265834234 -0.2126168117 0.4354536744 -0.2743829149 0.1216832040
[11] -0.6844212552 0.1039673090 0.1524993017 0.4073060312 -0.1489997560
[16] -0.1219058498 0.0518786600 -0.0366318221 -0.0585762956 0.1214087318
[21] 0.2914920997 -0.4873872335 0.0587487998 0.1045606161 -0.1076579799
[26] 0.3291820120 -0.0385596256 -0.4979975014 -0.4001969013 -0.7302258462
[31] 0.2345737417 0.1156806949 0.2096873915 -0.4936905524 -0.2449190903
[36] -0.1508659005 -0.0014227738 0.2967625691 -0.2537830796 -0.2461055484
[41] -0.2451631755 -0.1920019474 0.2895554277 0.1288762437 -0.1347682803
[46] -0.2744545880 -0.5252994967 0.2791346435 -0.6381762314 -0.1252401321
[51] -0.0004951174 0.0114562419 0.3599642112 -0.2761141295 0.6285391855
[56] -0.1093606533 -0.3672947908 -0.4297671459 -0.1934236136 -0.1885173813
[61] -0.4997432184 -0.6306983751 -0.3263376276 -0.1223770695 0.0757908897
[66] -0.2848544283 -0.0898688981 -0.2221521703 0.0435699595 0.1121509586
[71] -0.0623147183 -0.2377333191 0.0718247896 -0.2861564002 -0.4605092432
[76] 0.3423907088 0.1919356895 -0.0835328740 -0.2740207641 -0.5224279413
[81] -0.2430484194 0.0617400228 -0.0657674332 -0.5329065636 0.1792780731
[86] -0.5723377317 -0.6175899486 -0.3336960605 0.3039800573 -0.2072807718
[91] -0.0580259057 -0.0308214061 -0.1169458515 0.1002410213 0.1333763186
[96] -0.2390179186 -0.2752171553 -0.2782828136 -0.1332935256 0.3316559918
[101] 0.0670261608 -0.1087403376 0.1078040265 -0.5734297021 -0.2168583251
[106] 0.0684008583 -0.0374538707 0.1059987423 -0.0440705140 0.5522671911
[111] 0.1276823246 0.2504434271 0.3017206200 -0.4510366722 0.6697086915
[116] -0.3444026573 0.0552866721 0.2387216505 0.2580513664 -0.5665694742
[121] -0.1847775642 0.1111521411 0.0669369923 0.3610244862 -0.2474149870
[126] 0.6183330453 0.4576669084 -0.2534656859 -0.0239219994 -0.5238427619
[131] 0.1734236331 -0.1187441337 0.2901218144 0.1915548446 -0.0790924294
[136] -0.1314571682 0.5979273270 0.3115471014 -0.3255483597 -0.1375897222
[141] -0.0035596214 -0.2588824556 -0.5722113663 0.1668774407 0.0944410281
[146] 0.6059384393 -0.4490751474 -0.7073658153 0.3145776504 0.0119405600
[151] 0.2202477126 -0.0915064952 0.4892466235 0.4679491164 -0.2186106131
[156] 0.2388073208 0.0140075374 -0.9965684339 -0.1062575681 -0.2732492724
[161] -0.0613632915 0.2825695859 -0.1499403952 0.0505028203 0.2073998698
[166] -0.1042802206 -0.2040666678 -0.2822271185 0.4892629896 -0.1848975025
[171] 0.7835936984 0.3241054603 0.1336791761 0.1486049629 0.7070096096
[176] -0.4584829896 0.0911697294 0.6095382672 0.6767660868 0.0691381065
[181] 0.4609167967 -0.1476737430 0.8499129515 -0.1233185404 0.5146103083
[186] -0.0493066535 -0.4731418293 -0.6004739301 0.4827352384 -0.4403364206
[191] 0.2045967291 -0.1975885607 -0.2260419318 0.3751280201 -0.4738249570
[196] -0.1732783159 0.2793322904 -0.0597761039 -0.0034213013 0.1917276649
[201] -0.0122665471 0.2580269914 0.2484639704 0.4644674488 0.1814773394
[206] 0.1438823200 -0.5207255469 0.3573729893 0.0939975835 -0.4852373792
[211] 0.5114588338 0.2120526440 -0.4331022861 0.1708639245 0.0978603687
[216] -0.0289647785 0.5165798837 0.1451683237 0.1205022045 -0.2574670283
[221] -0.1366693779 -0.1970416709 -0.2703439716 0.0440827107 -0.1064827720
[226] -0.1454662240 -0.3083949295 0.1324861726 0.0550016242 -0.2292828643
>
> proc.time()
user system elapsed
1.314 1.516 2.819
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: 0x5aeb3e08aff0>
> .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: 0x5aeb3e08aff0>
> .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: 0x5aeb3e08aff0>
> .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: 0x5aeb3e08aff0>
> 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: 0x5aeb3dd36710>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5aeb3dd36710>
> .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: 0x5aeb3dd36710>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5aeb3dd36710>
> .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: 0x5aeb3dd36710>
> 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: 0x5aeb3e09a3f0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5aeb3e09a3f0>
> .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: 0x5aeb3e09a3f0>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5aeb3e09a3f0>
> .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: 0x5aeb3e09a3f0>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5aeb3e09a3f0>
> .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: 0x5aeb3e09a3f0>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5aeb3e09a3f0>
> .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: 0x5aeb3e09a3f0>
> 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: 0x5aeb3d7d18c0>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5aeb3d7d18c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5aeb3d7d18c0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5aeb3d7d18c0>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile72392360213f2" "BufferedMatrixFile723924361abd6"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile72392360213f2" "BufferedMatrixFile723924361abd6"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5aeb3d4fde30>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5aeb3d4fde30>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5aeb3d4fde30>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5aeb3d4fde30>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5aeb3d4fde30>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5aeb3d4fde30>
> .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: 0x5aeb3e659790>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5aeb3e659790>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5aeb3e659790>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5aeb3e659790>
> 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: 0x5aeb3da44860>
> .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: 0x5aeb3da44860>
> rm(P)
>
> proc.time()
user system elapsed
0.243 0.050 0.283
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.242 0.042 0.272